-
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_template
(immutable resources) cannot be updated due to terraform_labels
when upgrading to v5
#16424
google_compute_instance_template
(immutable resources) cannot be updated due to terraform_labels
when upgrading to v5
#16424
Comments
google_compute_instance_template
cannot be updated when upgrading to v5google_compute_instance_template
(immutable resources) cannot be updated when upgrading to v5
google_compute_instance_template
(immutable resources) cannot be updated when upgrading to v5google_compute_instance_template
(immutable resources) cannot be updated due to terraform_labels
when upgrading to v5
Also: #16374 |
The upgrade guide states that EDIT: I ended up updating state entries manually since this appears to be an output-only change. Leaving my cat state.tfstate \
| jq '(.serial += 1) | (.resources[] | select(.type == "google_compute_instance_template").instances[].attributes) |= . + {terraform_labels: .labels}' \
>state.tfstate2 |
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
1.5.6
1.6.3
Affected Resource(s)
ForceNew=true
on theterraform_labels
fieldTerraform Configuration Files
Debug Output
plan
apply
Panic Output
N/A
Expected Behavior
Actual Behavior
We are upgrading from v4 to v5, and I am aware of the new
terraform_labels
change https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/version_5_upgrade#providerAccording to
terraform plan
, the computedterraform_labels
field will be populated. Uponterraform apply
, we got an error complainingError: doesn't support update
.Steps to Reproduce
google_compute_instance_template
and apply it using v4 providerterraform_labels
Error: doesn't support update
.Important Factoids
References
google_compute_instance_template
is immutable. Hence other fields contain aForceNew=true
in the schema definition:terraform-provider-google/google/services/compute/resource_compute_instance_template.go
Lines 156 to 164 in 3a7a8eb
However,
terraform_labels
does not have this attribute, introduced in 3e00cfb#diff-ac874ea0db4bd5f5a83e2c2ed7f1dcb0514262d10a386b119e882986c2c58bd6R869-R873terraform-provider-google/google/services/compute/resource_compute_instance_template.go
Lines 869 to 875 in 3a7a8eb
The workaround is manually tainting all instances of
google_compute_instance_template
prior to runningterraform apply
during the upgrade; this will force a replacement.doesn't support update
error terraform-provider-aws#33097b/309602560
The text was updated successfully, but these errors were encountered: