-
Notifications
You must be signed in to change notification settings - Fork 232
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
DiffSuppressFunc should be used for "Objects have changed outside of Terraform" logic #801
Comments
Hi @NiklasWagner! Thanks for opening this issue. What you've described here is a Terraform SDK behavior rather than a Terraform Core behavior, so I've transferred this issue into the Terraform SDK repository. While I'm not on the team responsible for the SDK, I do want to note here that the current SDK behaviors (warts and all) are generally frozen at this point due to how many providers are relying on them, and so I expect this issue is more likely to be addressed by the new provider development framework, which is not constrained by remaining compatible with accidental misbehaviors in existing providers. (There's so much provider code out there at this point that we've found that every bug and design oversight is inevitably being relied upon by someone, somewhere.) There's actually already hashicorp/terraform-plugin-framework#70 tracking the new-framework version of this same request, so you might find it interesting to track that one to see how that design discussion develops. |
thanks for moving my issue to the correct place. Its understandable that the behaviour of the existing SDK is probably not going to change but its great to see that Hashicorp is already working on a new framework and already have a existing issue basically covering my report :) Thanks for the quick reply, looking forward to have this design issue fixed at some point. |
The next version of terraform-plugin-sdk/v2, unreleased at the moment, but slated to be v2.11.0 adds an additional We expect |
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. |
Terraform Version
Terraform Configuration Files
Debug Output
https://gist.github.com/NiklasWagner/b48d8ccbc30118d2d0aac1cd89a1f00a
Crash Output
Expected Behavior
Running
terraform apply
multiple times should not show any "Objects have changed outside of Terraform" warnings.The
DiffSuppressFunc
should be used before the planing phase(?).Actual Behavior
Running
terraform apply
multiple times results in "Objects have changed outside of Terraform" warnings. This is due to the AWS API responding with the policy document in different order each time.The Terraform AWS provider uses a DiffSuppressFunc which already handles the random order issue correctly by using a hashmap.
Saidly (it looks like that) the
DiffSuppressFunc
is not used when comparing resources within the "Objects have changed outside of Terraform" logic.Steps to Reproduce
terraform init
terraform apply
(should create the resources)terraform apply
(should show a diff in the Pricipal ARN list, if not run multiple times)Additional Context
References
Multiple resources are affected in the AWS provider. All with the same policy document issue in different resources:
values
array of length 1 terraform-provider-aws#20456The text was updated successfully, but these errors were encountered: