-
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
Improper lifecycle of maintenance_interval in VM scheduling block #16345
Improper lifecycle of maintenance_interval in VM scheduling block #16345
Comments
@edwardmedia if not obvious, these are all |
It sounds like maintenance_interval is not expected to be updatable; in that case this is correctly a bug and would be resolved by setting ForceNew on the field. The behavior of not seeing a diff when removing the scheduling block is likely due to it being Optional + Computed, which preserves values when a field is removed. |
Yes, I believe instance templates do not support update for any of their properties. https://cloud.google.com/compute/docs/reference/rest/beta/instanceTemplates |
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. |
Community Note
modular-magician
user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned tohashibot
, a community member has claimed the issue already.Terraform Version
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
I apply the module above, supplying a project ID at the CLI. Then I comment out the scheduling block and re-apply. I expect that Terraform will plan the removal of maintenanceInterval field from the template, probably through destroy / create.
Actual Behavior
The Terraform plan is empty - i.e. it doesn't detect that I have removed the (non-default) setting of maintenance_interval. I can verify that the field is in the template through
gcloud beta compute instance-templates describe ...
:Steps to Reproduce
terraform apply
(supply project ID)terraform apply
(supply project ID)Alternative test
scheduling
block and provision a template. That goes fine.on_host_maintenance = "TERMINATE"
to the scheduling block. This results in the appropriate replacement plan:on_host_maintenance = "TERMINATE"
in the block, and addmaintenance_interval = "PERIODIC"
. It proposes an in-place replacement of the template, which cannot happen. The error looks like:The text was updated successfully, but these errors were encountered: