Skip to content
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

Updating description field of google_compute_instance forces replacement #11433

Comments

@mponton-cn
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
  • If an issue is assigned to the 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 to hashibot, a community member has claimed the issue already.

Terraform Version

Terraform v1.1.7
on windows_amd64

  • provider registry.terraform.io/hashicorp/google v4.16.0
  • provider registry.terraform.io/hashicorp/local v2.2.2
  • provider registry.terraform.io/hashicorp/null v3.1.1
  • provider registry.terraform.io/hashicorp/random v3.1.2
  • provider registry.terraform.io/hashicorp/time v0.7.2
  • provider registry.terraform.io/hashicorp/tls v3.2.1
  • provider registry.terraform.io/vmware/vra v0.3.11

Affected Resource(s)

  • google_compute_instance

Terraform Configuration Files

I don't have an anonymized reproducer at this time but could provide one if needed.

Debug Output

I don't have an anonymized output at this time and I am not sure it will be needed but can provide one if necessary.

Expected Behavior

  1. Deploy google_compute_instance to GCP with some value for field description
  2. After deployment, update description field in Terraform file and apply again
  3. I expect Terraform to do an in-place update of the ressource and update the description

Actual Behavior

  1. Deploy google_compute_instance to GCP with some value for field description
  2. After deployment, update description field in Terraform file and apply again
  3. Terraform says the updated field FORCES REPLACEMENT and will destroy the VM

e.g.:
image

Steps to Reproduce

Deploy a VM and update the description field after deployment. See above.

Important Factoids

I initially thought this was due to some GCP API limitation but looking at the instance endpoint there is an update method that seems to be able to update the description field:

https://cloud.google.com/compute/docs/reference/rest/v1/instances/update

Moreover the GCP documentation also seems to say we should be able to update the description without affecting the VM here:

https://cloud.google.com/compute/docs/instances/update-instance-properties#updatable-properties

@rileykarson
Copy link
Collaborator

Note: This is sized assuming #6857 is complete (6857 is a prerequisite)

@rileykarson rileykarson added this to the Goals milestone Apr 11, 2022
@sanghaniJ
Copy link
Contributor

I've gone through this issue and the request is regarding support for the description field to not be Force-New.

  • As mentioned in the comment, new update API needs to be used.
  • Once, it is available, as per Update we need to use REFRESH.
  • Then in the schema, we need to remove ForceNew and add the attribute in the update.

@sanghaniJ
Copy link
Contributor

b/263862919

@LucaPrete
Copy link
Contributor

Working on this. PR coming

Copy link

github-actions bot commented Feb 4, 2024

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.