-
Notifications
You must be signed in to change notification settings - Fork 9.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot delete IAM role without permissions to delete non-existent RoleBoundary #5489
Comments
I encountered this issue too while implementing permission boundaries in my context. It seems the It does not seem necessary to remove the permission boundary from the role prior to deleting it : I can confirm that an Working on a PR to fix this. |
…on_delete Issue #5489 : don't call DeleteRolePermissionsBoundary when deleting IAM role
Hi, folks. 👋 Sorry for the trouble here! This was an implementation mistake on my part. When I was adding this support to both the IAM user and IAM role resources, I discovered the IAM user resource required the permissions boundary deletion or it returned a deletion conflict so I just presumed the IAM role resource would need the same. The IAM role resource does not need this as noted above. 😅 Thanks @russellcardullo and @mgarstecki for reporting and fixing this! The fix (#5544) has been merged into master and will release with version 1.32.0 of the AWS provider, likely later today or tomorrow. 👍 |
This has been released in version 1.32.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Community Note
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Debug Output
https://gist.github.com/russellcardullo/bbbafc7e2ca7c9527d09cbff3319d807
Expected Behavior
Terraform would not make a call to delete role boundaries if I did not set any in the terraform config.
Actual Behavior
Terraform attempts to delete role boundaries which require the user to have additional permissions.
Steps to Reproduce
terraform apply
terraform destroy
Note, in my case I can add the additional permission to allow me to delete that. But it was surprising to me that I was able to create and delete resources like this before with the same permissions, but when updating to the latest terraform-aws provider I got this error.
Looks like this is a relatively new feature from AWS: https://aws.amazon.com/blogs/security/delegate-permission-management-to-developers-using-iam-permissions-boundaries/
I'm not sure if terraform always needs to delete role boundaries even if none exist. FWIW I can delete the role without issues through the AWS console without needing DeleteRolePermissionsBoundary permissions.
The text was updated successfully, but these errors were encountered: