-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
IAM Policy Principals: Objects have changed outside of Terraform #20665
Comments
Potentially related: jen20/awspolicyequivalence#10. |
Looks to be the same exact issue. Hoping for a solution soon. |
I was working on creating an issue and ran across this. Here's my test file. I thought it might have been related to a change in the aws provider v3.38.0, but it isn't. I tried before that and what is current right now (3.64.0). I thought that if I sorted the json list it might keep it from soft drift (requiring a refresh), but that's incorrect. After rerunning many times from scratch, the order of the principals list is deterministic at creation, not before. It makes me think that it's being stored by the IAM unique_id, not ARN. Or something. I've tried it with a list of strings (eg "arn::...user1", "arn::...user2") and as a list of terraform resources. It's nondeterministic in both cases. It's also true for users, roles, pretty much anything stuffed in the identifiers list. It's apparently not ordered by the IAM's unique_id, though. Here's the diff on a run, the internal order is "1 4 2 3".
I output the unique ids:
If those are alphasorted, the order is "2 4 3 1". Even reversed would be incorrect, "1 3 4 2". -- Final note, if my experiment is revised to use
|
this is related to (or a dupe of) #11801. Also similar to #20107, hashicorp/terraform#28803 |
Thanks for raised this problem. It should be resolved in #21969 so I'm going to close. If you're still experiencing any related problems, please re-open this or submit a new issue! |
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. |
After upgrading to TF v1.0.1, I began receiving the "refresh report" in the terraform plan/apply output. I've also updated to the latest AWS provider version, v3.55.0. I keep getting the output shown below for simple reordering of principals by AWS in our IAM/Key policies. I've ran "terraform apply -refresh-only" to no success.
Terraform Version
Terraform Configuration Files
Output
Expected Behavior
Once state file has been refreshed the output should run clean.
Actual Behavior
Keep getting the same output shown above regardless of how many times i run "terraform apply -refresh-only".
References
The text was updated successfully, but these errors were encountered: