-
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
aws_iam_role_policy name collision #14387
Comments
Hi @frumpled 👋 Thank you for submitting this and this is an excellent use case of somewhere that Terraform and the Terraform AWS Provider could be much more helpful since in many cases they have enough information to return an error upfront during planning instead of unexpected behavior during apply. I believe this falls under the provider-wide enhancement proposal of #14394, so by adding this link here it will add a reference to that issue so we can include it as a use case when thinking about the implementation details. Since this is likely something we will want more broadly across many resources, I'm going to close this particular issue to consolidate discussions, efforts, and prioritization on the topic while the reference would serve as the cue to make this specific resource one of the initial implementations. I would suggest those 👍 upvoting and subscribing here to do so on #14394 so we can appropriately gauge interest. Please feel free to provide feedback there. Thanks again! |
Thanks for the helpful info and tidying things up into a single issue @bflad 😄 |
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 CLI and Terraform AWS Provider Version
Terraform v0.11.10
Provider:
aws
Provider version:
~> 1.57
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
The plan fails and reports that there's a collision of resources and identifies these resources.
Actual Behavior
When two
aws_iam_role_policy
resources share a name (they shouldn't, but things happen, especially in shared repositories 🤷♂️ ):terraform plan
shows that changes are detected and shows that policy resources are being updated.terraform apply
shows that the changes applied and there is nothing else to report, concealing the fact that an existing policy was swapped out / overwritten and that a new plan would result in more changes.Running the plan and apply commands does not report an issue and appears to apply both as intended,
however it actually overwrites one and subsequent plans/applies just swap one out for the other in an endless a loop, reporting no issue.
Steps to Reproduce
terraform plan
terraform apply
Important Factoids
Terraform plans and applies were done using "atlantis":
https://github.com/runatlantis/atlantis
Because of this, I can't actually run
terraform -v
or similar; atlantis does not give this as an option 😿The text was updated successfully, but these errors were encountered: