-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
[WIP] helper/schema: implement ComputedWhen #4846
Conversation
// finished the diff. | ||
// TODO | ||
for k, schema := range m { |
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.
Here be dragons. Lots of looping logic below. Would love to come up with a more elegant way to do this. Considered attempting to thread ComputedWhen knowledge/context into the original diff generation rather than this post-hoc munging, but initial spikes felt even more messy than this.
ComputedWhen is a long `TODO`d schema feature that allows any field to be marked as computed when some terget field changes. Right now Terraform has no way of invalidating a field until it sees _that_ field changes, but there are plenty of examples of scenarios where one field changing implies that another field is going to be assigned a new value.
0914559
to
2761e3c
Compare
ComputedWhen is still a good idea to implement, as it has the potential to trigger richer plan-time output, but this is an old PR and I have no plans to pick it up in the foreseeable future. /cc @jbardin to put this on your "someday" radar 💌 |
@jbardin: is there any update on this issue of the implementation of |
Hi @mavogel, I think this use case is now more generally covered by the new |
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. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
ComputedWhen is a long
TODO
d schema feature that allows any field tobe marked as computed when some target field changes.
Right now Terraform has no way of invalidating a field until it sees
that field changes, but there are plenty of examples of scenarios
where one field changing implies that another field is going to be
assigned a new value.
I'd like to do a bit more testing and refactoring before this is fully ready. But I wanted to push what I had for now since it seems to be working for the cases I've tried it.
This should improve the experience of using consul_keys and atlas_artifacts (for scenarios where two plan/apply cycles would be required for a change to propagate), as well as any other resources where we find similar scenarios that we'd like to use
ComputedWhen
.