-
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
google_compute_instance_from_template ignores values defined in template #3076
Comments
I ran into this as well. Duplicating the scheduling block in each instance from template worked around the issue, but it was confusing to not have the automatic_restart updated from the template. |
Just ran into the same error a few minutes ago. Took me a bit of time to figure out that the |
* GKE Cluster Autoscaling profile * autoscaling profile and tests * fix sqladmin api usage * fixes * update documentation * fix sql api url and base path * merge upstream changes to sql * fix indentation character Signed-off-by: Modular Magician <[email protected]>
* GKE Cluster Autoscaling profile * autoscaling profile and tests * fix sqladmin api usage * fixes * update documentation * fix sql api url and base path * merge upstream changes to sql * fix indentation character Signed-off-by: Modular Magician <[email protected]>
@edwardmedia Great to see this get fixed! Unfortunately, I have not been working with Terraform recently and I do not have time to help test. |
@conorgil Please feel free to reopen it if you still see this is an issue. Thank you |
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! |
Community Note
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Config with the bug:
Config without the bug (duplicates the
scheduling
block in thegoogle_compute_instance_from_template
resource):Debug Output
See gist.
Notice that the request to create the template successfully returns on L55 and correctly sets
scheduling.preemptible = true
andscheduling.automatic_restart = false
. Also, the request to retrieve the template on L155 returns the correct values in thescheduling
block.Then, the request to create the instance (presumably using the template) uses the incorrect values for the
scheduling
block on L192. It looks like it completely ignores the values in the template and uses defaults for creating an instance.Expected Behavior
The instance created should have used the
scheduling
options defined in the template.Actual Behavior
The Request to create the instance did not use the
scheduling
options defined in the template and instead used the default for creating an instance. Specifically, it should have setscheduling.automatic_restart = false
because that is defined in the template, but it defaulted to usescheduling.automatic_restart = true
, which conflicts withscheduling.preemptible = true
.Steps to Reproduce
Use the config above that has the bug:
terraform apply
and you will see the error
Use the config above that uses the work around of duplicating the
scheduling
block in thegoogle_compute_instance_from_template
resource and see that it runs without error.The text was updated successfully, but these errors were encountered: