-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Change automatic_restart to be computed if not specified #206
Conversation
I definitely agree that the deprecated value should be computed & optional, if not removed entirely. My concern with setting the second value to computed as well means that when we move from scheduling {
automatic_restart = true
} to scheduling {
} Terraform won't see any diffs, and the resource won't get recreated. This means that the second scheduling block doesn't guarantee that the server-side resource's property is false; it can be true if there was an already existing resource and we modified the config. What happens if the deprecated value is computed and the new one isn't? Especially in the case where users were relying on the old default of true in their configs. I expect we'll have enough diffs/recreates that we need to use Computed like this, but being able to stop that corner case before it happens would be nice as well. |
ForceNew: true, | ||
Computed: true, |
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.
If you set this field to Computed, it means a user cannot specify a value for automatic_restart
. GCP default value for this field is true. It means a user could never create an instance with terraform with automatic_restart = false
. I am confused about why that would be something desirable.
Am I missing something?
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.
To my understanding, Computed
means that it can't be set and can only be read, but Computed
and Optional
means that it acts like it is Computed
until a value is set in config, at which point it is treated as Optional
.
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.
Thanks for the clarification, I wasn't aware of this "trick"
@rosbo The docs on
|
A main problem here is that there's no way to infer whether or not |
What about just making sure that you can not define |
Good point @dgolja; this PR is not complete and is off-topic from the original issue. I'll close this for now and submit a new one specifically around removing the deprecated parameter (which has been deprecated since 2015) and fixing scheduling.automatic_restart. |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
Fixes #107