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

google_compute_per_instance_config/google_compute_region_per_instance_config sends the wrong argument #13062

Closed
cg547 opened this issue Nov 17, 2022 · 1 comment · Fixed by GoogleCloudPlatform/magic-modules#6841, hashicorp/terraform-provider-google-beta#4898 or #13067
Assignees
Labels

Comments

@cg547
Copy link

cg547 commented Nov 17, 2022

The value set in the most_disruptive_allowed_action argument in the google_compute_per_instance_config / google_compute_region_per_instance_config resources is sent to the API in the mostDisruptiveActionAllowed JSON field, but the API uses the mostDisruptiveAllowedAction field.

This causes unwanted instance replacement, since the default value is REPLACE.

obj["mostDisruptiveActionAllowed"] = mostDisruptiveAction

obj["mostDisruptiveActionAllowed"] = mostDisruptiveAction

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.3.3
on linux_amd64
+ provider registry.terraform.io/hashicorp/google v4.43.1
+ provider registry.terraform.io/hashicorp/google-beta v4.43.1
+ provider registry.terraform.io/hashicorp/random v3.3.2

Affected Resource(s)

  • google_compute_per_instance_config
  • google_compute_region_per_instance_config

Terraform Configuration Files

resource "google_compute_per_instance_config" "REDACTED" {
  name                             = "REDACTED"
  instance_group_manager           = google_compute_instance_group_manager.REDACTED.name
  zone                             = "REDACTED"
  minimal_action                   = "NONE"
  most_disruptive_allowed_action   = "NONE"
  remove_instance_state_on_destroy = true

  preserved_state {
    disk {
      device_name = "REDACTED"
      source      = google_compute_disk.REDACTED.id
    }
  }
}

Debug Output

---[ REQUEST ]---------------------------------------
POST /compute/v1/projects/REDACTED/zones/REDACTED/instanceGroupManagers/REDACTED/applyUpdatesToInstances?alt=json HTTP/1.1
Host: compute.googleapis.com
User-Agent: Terraform/1.3.3 (+https://www.terraform.io) Terraform-Plugin-SDK/2.10.1 terraform-provider-google/dev
Content-Length: 131
Content-Type: application/json
Accept-Encoding: gzip

{
 "instances": [
  "zones/REDACTED/instances/REDACTED"
 ],
 "minimalAction": "NONE",
 "mostDisruptiveActionAllowed": "NONE"
}

-----------------------------------------------------

Panic Output

Expected Behavior

The API call sets mostDisruptiveAllowedAction to NONE.

Actual Behavior

The API call sets mostDisruptiveActionAllowed to NONE.

Steps to Reproduce

  1. terraform apply

Important Factoids

References

@cg547 cg547 added the bug label Nov 17, 2022
@edwardmedia edwardmedia self-assigned this Nov 17, 2022
c2thorn pushed a commit to GoogleCloudPlatform/magic-modules that referenced this issue Nov 17, 2022
Co-authored-by: Edward Sun <sunedward@google.com>
Fixes hashicorp/terraform-provider-google#13062
modular-magician added a commit to modular-magician/terraform-provider-google-beta that referenced this issue Nov 17, 2022
Co-authored-by: Edward Sun <sunedward@google.com>
Fixes hashicorp/terraform-provider-google#13062

Signed-off-by: Modular Magician <magic-modules@google.com>
modular-magician added a commit to modular-magician/terraform-provider-google that referenced this issue Nov 17, 2022
Co-authored-by: Edward Sun <sunedward@google.com>
Fixes hashicorp#13062

Signed-off-by: Modular Magician <magic-modules@google.com>
modular-magician added a commit to hashicorp/terraform-provider-google-beta that referenced this issue Nov 17, 2022
Co-authored-by: Edward Sun <sunedward@google.com>
Fixes hashicorp/terraform-provider-google#13062

Signed-off-by: Modular Magician <magic-modules@google.com>

Signed-off-by: Modular Magician <magic-modules@google.com>
modular-magician added a commit that referenced this issue Nov 17, 2022
Co-authored-by: Edward Sun <sunedward@google.com>
Fixes #13062

Signed-off-by: Modular Magician <magic-modules@google.com>

Signed-off-by: Modular Magician <magic-modules@google.com>
googlerjk pushed a commit to googlerjk/magic-modules that referenced this issue Nov 22, 2022
googlerjk pushed a commit to googlerjk/magic-modules that referenced this issue Nov 25, 2022
kimihrr pushed a commit to kimihrr/kimiah-magic-modules that referenced this issue Dec 6, 2022
hao-nan-li pushed a commit to hao-nan-li/magic-modules that referenced this issue Dec 6, 2022
@github-actions
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 Dec 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.