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
Warn when ignore_changes includes a Computed attribute #30517
Conversation
Add a test verifying that attempting to add a nonexistent attribute to ignore_changes throws an error.
Return a warning if a Computed attribute is present in ignore_changes, unless the attribute is also Optional. ignore_changes on a non-Optional Computed attribute is a no-op, so the user likely did not want to set this in config. An Optional Computed attribute, however, is still subject to ignore_changes behaviour, since it is possible to make changes in the configuration that Terraform must ignore.
7b6faac
to
d6cc3d9
Compare
9794650
to
4e3507f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me!
I left an inline comment about the text of the error message. I'm sorry I didn't catch that the first time I looked here; I think when I was here the first time I was focused only the one active comment thread and didn't look at the rest of the diff. 😖
I feel hopeful that if we introduce the other ignore_changes
-alike thing we've been sketching it'll be able to reuse this same validation logic and thus not necessarily require generalizing the trick of trimming off that leading dot from the displayed address, but if that turns out to make things awkward then not the end of the world to have a helper function to do it, I suppose. We'll see how that turns out in the subsequent PR! 😀
Reminder for the merging maintainer: if this is a user-visible change, please update the changelog on the appropriate release branch. |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
Adding a (non-Optional) Computed attribute to
ignore_changes
is a no-op, so we should warn users when they do this, as it is likely they intended something else.Throwing an error here would be a breaking change.
Also adds test for the
StaticValidateTraversal()
check that verifiesignore_changes
paths are present in the schema.