While onboarding an unmanaged EFS volume that I just created I got an error because I forgot to create a mount target for it.
After fixing the issue I went back and ran the onboarding again but this time I got an EntityAlreadyExists error because the IAM Role was leftover from the previous execution.
This happens, I think, because the create_function_role function is called inside the create_function function, see here, but in the except block of the create_function function invocation we are deleting only the access point, not the IAM Role, see here.
I'd recommend trying to delete the IAM Role just created if the onboarding operation fails, if you agree I'm happy to open a PR.
While onboarding an unmanaged EFS volume that I just created I got an error because I forgot to create a mount target for it. After fixing the issue I went back and ran the onboarding again but this time I got an
EntityAlreadyExists
error because the IAM Role was leftover from the previous execution.This happens, I think, because the
create_function_role
function is called inside thecreate_function
function, see here, but in theexcept
block of thecreate_function
function invocation we are deleting only the access point, not the IAM Role, see here.I'd recommend trying to delete the IAM Role just created if the onboarding operation fails, if you agree I'm happy to open a PR.