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

Cannot update value of network_interface.stack_type on google_compute_instance resources #17210

Closed

Comments

@SarahFrench
Copy link
Member

SarahFrench commented Feb 7, 2024

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 a user, that user is claiming responsibility for the issue.
  • Customers working with a Google Technical Account Manager or Customer Engineer can ask them to reach out internally
    to expedite investigation and resolution of this issue.

Terraform Version

Terraform v1.5.7
on darwin_arm64

  • provider registry.terraform.io/hashicorp/google v5.15.0

Affected Resource(s)

  • google_compute_instance

Terraform Configuration

resource "google_service_account" "default" {
  account_id   = "my-custom-sa"
  display_name = "Custom SA for VM Instance"
}

resource "google_compute_instance" "default" {
  name         = "my-instance"
  machine_type = "n2-standard-2"
  zone         = "us-central1-a"

  tags = ["foo", "bar"]

  boot_disk {
    initialize_params {
      image = "debian-cloud/debian-11"
      labels = {
        my_label = "value"
      }
    }
  }

  // Local SSD disk
  scratch_disk {
    interface = "NVME"
  }

  network_interface {
    network    = "default"
    stack_type = "IPV4_ONLY"

    access_config {
      // Ephemeral public IP
    }
  }

  metadata = {
    foo = "bar"
  }

  metadata_startup_script = "echo hi > /test.txt"

  service_account {
    # Google recommends custom service accounts that have cloud-platform scope and permissions granted via IAM Roles.
    email  = google_service_account.default.email
    scopes = ["cloud-platform"]
  }
}

Debug Output

https://gist.github.com/SarahFrench/c15d40e63d01d15505e8578656bccff7

Expected Behavior

Can update network_interface.stack_type from IPV4_ONLY to IPV4_IPV6

Actual Behavior

Cannot update network_interface.stack_type from IPV4_ONLY to IPV4_IPV6

Steps to reproduce

  1. terraform apply
  2. Change network_interface.stack_type from IPV4_ONLY to IPV4_IPV6 in the config
    3.terraform apply => you'll see a plan to update the field, but after applying the plan the state is unchanged
  3. terraform apply => there is still a plan to update the field

Important Factoids

When the update happens there is never a PATCH request sent to the compute API to update the resource. It appears a defect in the provider code stops the change happening.

References

No response

b/324394301

Copy link

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 Mar 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.