-
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
Terraform is trying to detach a removed IAM Instance Profile #6082
Comments
Opened PR #6083 for evaluation |
Regarding this comment: |
Update on the PR here to resolve this issue. Terraform is not identifying resources that are attached by string reference instead of resource attribute. Correcting the template results in terraform mapping the dependencies properly and destroying resources in the proper order. |
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. |
Summary
Config
Error
Code
For sure roles cannot be deleted with IAM Profiles associated, but because terraform is managing the IAM Profile also, there's no guarantee it stills exists when API is called. Every time I got the same error.
Fix
PR
I'll open a new Pull Request with my suggestion and I'll update this issue. But, basically, what I'm doing is calling API before removing to double check if that Instance Profile still exists, and then delete it.
depends_on
We can also use depends_on to fix it.
Plan
We could change the plan to wait for IAM Instance Profile deletion and then remove the IAM Role. If we do this, that code block can be deleted
What do you guys think about it?
The text was updated successfully, but these errors were encountered: