-
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
Providers: Allow configuration or logic for Creating or Updating #113
Comments
I agree. I think there is room here for some meta-parameter to specify this behavior. Let me think on it. |
With TF 0.3 we added the
|
AFAICT this is still a valid feature request. I'm interpreting this as a lifecycle parameter that ensures any diff is equivalent to a |
(Ended up finding this just because I was curious as to what is the oldest open issue! 😀) A lifecycle attribute as discussed in the above examples would get to the original use-case but would be a bit of a blunt instrument: the given use-case is for a specific attribute on a resource, rather than any attribute on that resource. So perhaps it would be appropriate to have an analog to resource "digitalocean_droplet" "web" {
image = "ubuntu-14-04-x64"
name = "web-1"
region = "nyc2"
size = "512mb"
lifecycle {
"force_replace" = ["size"]
}
} With that said, the motivating example of DigitalOcean requiring a replace only when |
This was effectively the approach used to implement |
Short of adding new options, |
The other issue #8769 that I mentioned above has now been completed, so it's possible to use the new old, new := d.GetChange("size")
if dropletSizeLower(new, old) {
d.ForceNew("size")
} Assuming a suitable implementation of This now allows providers to address the original use-case as stated. It may still be interesting to allow the user to override the behavior of particular attributes within configuration, but since that was not the original use-case presented and we don't seem to have a compelling reason to support it right now I'm going to close this out. If someone does have a use-case where forcing replacement rather than in-place modification is needed (and where running |
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. |
Sometimes you don't want to update a resource, but would rather have a new one.
An example is DigitalOcean. Sometimes, you just want a new droplet on resize instead of "resizing", or if you're resizing down, DO can't do that so you want it to be recreated.
There is definitely a need for richer logic here.
See also #107.
The text was updated successfully, but these errors were encountered: