-
Notifications
You must be signed in to change notification settings - Fork 44
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
IgnoreChanges unable to ignore set element changes #1756
Comments
Still don't have a complete picture of how to interpret ignore_changes and implement this is intuitive. Might be worth digging into how TF does it for sets https://developer.hashicorp.com/terraform/language/meta-arguments/lifecycle#ignore_changes In particular I am curious if the set hash is exposed explicitly so you can reference the set hash (or element identity) in your ignoreChanges (currently it's not really user-facing in Pulumi bridged projection), and if not, what is done to correlate numeric indices to set elements and how does ignoreChanges interact with changes that would affect an element's identity. |
Curiously per hashicorp/terraform#5666 and some experiments I ran it's not possible to ignore wildcards in TF, and in particular for 5666 it is annoying because TF displays set identity numbers in the diff which are not predictable by the user to target for ignoring. |
OpenTofu per https://github.com/opentofu/opentofu/blob/5079292cb29acb7ca0707e4eec436331ce147b60/internal/tofu/reduce_plan_test.go#L438 does not have test cases for ignoring set elements either. |
Adding a suggested move forward: #2240 It appears that current behavior is useful in some cases but not all, whereas upstream disallows it completely. Suggest proceeding with a warning. |
What happened?
Due to #1755 effect of how sets are represented in bridged providers, it is really impossible sometimes to ignore set updates using ignoreChanges.
IN programs like this: pulumi/pulumi-aws#2442 it is not unreasonable for the user to try to workaround incorrect provider diffs by saying this:
However currently this fails to suppress the diffs in question. To the diff it looks like the elements are added and removed instead of changed in-place. Therefore the diff looks bigger than just applyMethod.
Example
See above
Output of
pulumi about
N/A
Additional context
N/A
Contributing
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
The text was updated successfully, but these errors were encountered: