-
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
AssumeRolePolicy seems to be incorrectly normalized, resulting in re-planning for "whitespace changes" #21016
Comments
To work around this I changed the second part of the policy to look like this: condition {
test = "StringEquals"
variable = "oidc.eks.eu-west-1.amazonaws.com/id/x:sub"
values = ["system:serviceaccount:x:foo"]
} However it would still try to re-plan, now because the order of the principals in the first statement has differed from what is returned by IAM. |
I think I'm seeing a similar symptom with EKS pod identity; is this the false change output that you see?
|
For me, the issue occurred whenever I have 2 conditions no matter which condition come first. It will not detect any change if I have only one condition. I tried with these solutions and cannot solve the issue
|
It seems this issue should have been fixed regarding #11801 with 3.70.0 provider version. However, I still encounter the issue on my end, the order of the statements is still reordered. Maybe @YakDriver can give us more insights? |
We have exactly this problem with 3.70.0 as well, except it looks like the state file is storing two spaces and the API is returning four spaces when it comes to the indentation of the policies. We have 392 of these whitespace changes on every plan, which makes the plans themselves not very helpful. |
This is definitely still happening. I get a whitespace-only change in my state on every apply. |
Warning This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them. Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed. |
This functionality has been released in v5.43.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
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. |
Community Note
Terraform CLI and Terraform AWS Provider Version
Affected Resource(s)
Terraform Configuration Files
Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.
I have the following resources:
Debug Output
Running with
TF_LOG=trace
shows that the ordering of the conditions returned from IAM are different:Retrieved from IAM:
But stored in the statefile:
As you can see, the second statements conditionals have flipped in order. This causes constant re-plans.
Expected Behavior
Re-plans should not happen.
Actual Behavior
Re-plans happen
Steps to Reproduce
terraform apply
Important Factoids
References
The text was updated successfully, but these errors were encountered: