-
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
Metadata Data Source: trigger #14855
Comments
Hi @cemo, The usual solution to this problem is to use Let me know if that doesn't work for you, or if I'm missing part of this feature request. |
@jbardin Thanks, it will work. But what about having |
@cemo, I'm not sure what triggers in |
I considered this approach. This might be valid of all datasource but for the sake of simplicity this can be limited to
I am expect a constant value from |
@cemo I'm afraid I don't understand what behavior you'd expect for that. Would you mind elaborating a little more? It sounds like you're looking for a way to prevent a data resource from getting refreshed unless some value changes. If so, that would be a core change rather than something we can implement within a single data source, since the data resource lifecycle is fundamental. This reminds me a little of #11418, although that is about resources being replaced on arbitrary changes. I did a little thought experiment about a similar feature to control refreshing of data sources, but discovered a snag: data source refresh happens before the planning/diffing phase, so it's too early to do any sort of conditional work there. So I agree with @jbardin that I think if we were to also implement something like #11418 that would complete the picture here: you'd be able to disable the default behavior of rebuilding whenever the AMI changes, but you'd also be able to specify some other trigger to make it happen, so that you can use some different mechanism to decide if replacing the instance is desirable. |
You have the idea what I have in my mind. I am trying to create a constant datasource which is immune to changes. But I am not trying to block refresh lifecycle. I just try to manipulate output of it by looking triggers. It can again refresh itself.
I was considering something like this :) BTW I implemented as you suggested. It seems far more better to me. 👍 |
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. |
I am using
aws_ami
to find rightami
in my region. But I am afraid of its changes. I would like to create a freezed data source to protect myself from updates which can cause recreation of instances. Recreating instances is pretty much dangerous since it can simply destroy our cluster. I would like to freeze/fix data sources after fetching its data once. I think that a metadata liketrigger
might be useful which is similar innull_resource
.What do you think? Also what is the current way to be immune for changes in datasources?
The text was updated successfully, but these errors were encountered: