-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Failing to delete a role if if policies are attached #15301
Comments
Hi @aleybovich That said (which is why I labelled this as |
@radeksimko - thank you for looking into this! I understand that it's an expected behavior. Unfortunately, unmanaged policies are being added and that's outside of my control :) If you could add a flag that would force delete a role even if it has policies attached, that would greatly help me and anyone who's using 3rd party access control tools like turbot. Is it something you could add in the near future? I'm pretty much blocked until then :( |
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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
I'm using TF v0.9.7
I am adding a simple service role. Then I am running
terraform destroy
to delete that role and I am getting an erroraws_iam_role.code-deploy-ec2-instance-profile: DeleteConflict: Cannot delete entity, must detach all policies first.
After some troubleshooting I realized that turbot (the 3rd party software that manages our enterprise aws accounts) attaches its own additional policies to any created roles. So, when terraform tries to delete the role, those policies, added outside of terraform, cause the error.
Is there any way to force detach all unmanaged policies using terraform so I could successfully destroy the managed role?
The text was updated successfully, but these errors were encountered: