-
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
[Tracking Issue] Order is lost in JSON/policies when applied #21968
Comments
aws_iam_policy_document
when appliedaws_iam_policy_document
when applied
aws_iam_policy_document
when applied
This functionality has been released in v3.70.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
Relates #22048
Centralized JSON List/Array Diff Issue
When Terraform reports a spurious diff, it can be inconvenient. If that non-diff forces replacement, it can seriously affect systems. We don't want that.
This issue focues on AWS provider non-diffs occurring on AWS policy JSONs. It is looking at the problem, tracking fixes, and gathering references.
Diffs vs. Reordering vs. Preserving Order vs. Ignoring Order
Assuming that non-diff diffs (i.e., spurious diffs) are the crux of the problem, consistent reordering (such as alphabetical or anti-alphabetical as with #6107), preserving the given order, or completely ignoring order within JSON arrays can all be solutions. Many times issues suggest some variation of ordering but the bottom-line reason seems to be avoiding diffs.
Step 1
In this round of fixes, the approach is to ignore order by only setting a new policy JSON when it is not equivalent to the existing policy JSON. The data source
aws_iam_policy_document
takes a different approach by reordering the JSON arrays, currently anti-alphabetically (see #6107).Companion Issue to #11801
Perhaps the most popular issue to describe these problems is #11801. Rather than hijack it, this is a generalized issue and central place for documenting similar problems and tracking fixes.
Fixes Needed
References
Provider References
aws_iam_policy_document
when applied to S3 buckets, iam roles, kms keys, etc #11801values
array of length 1 #20456Other References
The text was updated successfully, but these errors were encountered: