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

Can't remove attributes inside all_instances_config on google_compute_region_instance_group_manager #15688

Open
edwardmedia opened this issue Aug 30, 2023 · 3 comments

Comments

@edwardmedia
Copy link
Contributor

edwardmedia commented Aug 30, 2023

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

Affected Resource(s)

  • google_compute_region_instance_group_manager

Terraform Configuration Files

resource "google_compute_instance_template" "appserver" {
  name           = "appserver-template"
  machine_type   = "e2-medium"
  region = "us-west1"

  disk {
    source_image = data.google_compute_image.my_image.self_link
    auto_delete  = true
    boot         = true
  }

  network_interface {
    network = "default"
  }
}


resource "google_compute_region_instance_group_manager" "appserver" {
  provider = google-beta
  name = "appserver-igm"

  base_instance_name         = "app"
  region                     = "us-west1"
  distribution_policy_zones  = ["us-west1-a", "us-west1-b"]

  version {
    instance_template = google_compute_instance_template.appserver.self_link_unique
  }
  all_instances_config {.      <----- can't update by remove below attributes
/*
    metadata = {
      metadata_key = "metadata_value"
    }
    labels = {
      label_key = "label_value"
    }
*/
  }
}

With a PATCH request, the API does nothing

 ---[ REQUEST ]---------------------------------------
 PATCH /compute/beta/projects/myproject/regions/us-west1/instanceGroupManagers/appserver-igm
 Host: compute.googleapis.com
 {
  "allInstancesConfig": {
   "properties": {
    "labels": null,
    "metadata": null
   }
  },
  "fingerprint": "my8NjOSfB44="
 }

b/298256272

b/312433534

@github-actions github-actions bot added forward/review In review; remove label to forward service/compute-managed labels Nov 16, 2023
@melinath melinath removed the forward/review In review; remove label to forward label Nov 16, 2023
@askubis
Copy link

askubis commented Mar 6, 2024

I see this issue, I agree with the problem.
I will work on solving this.
In the meantime I suggest the workaround by changing to useless values, e.g. when you want to delete all metadata, you might instead use
metadata = {
useless_key = "useless_value"
}

I'll let you know when the original option works

@askubis
Copy link

askubis commented May 29, 2024

It does work now. Sorry for the inconvenience.

@askubis
Copy link

askubis commented May 29, 2024

please test and close this issue when test is successful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants