Skip to content

Documentation Bug: google_compute_region_commitment type argument lists GENERAL_PURPOSE_N1 incorrectly #25469

@alandyoho

Description

@alandyoho

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 & Provider Version(s)

Terraform vX.X.X
on

  • provider registry.terraform.io/hashicorp/google vX.X.X
  • provider registry.terraform.io/hashicorp/google-beta vX.X.X

Affected Resource(s)

  • google_compute_region_commitment

Terraform Configuration

resource "google_compute_region_commitment" "cud-6-n1-us-east1" {
  name     = "cud-6-n1-us-east1"
  plan     = "THIRTY_SIX_MONTH"
  type     = "GENERAL_PURPOSE_N1" # This value causes an error
  category = "MACHINE"
  auto_renew = false
  region   = "us-east1"

  resources {
    type   = "VCPU"
    amount = "750"
  }

  resources {
    type   = "MEMORY"
    amount = "2816000"
  }
}

Debug Output

No response

Expected Behavior

The Terraform provider documentation should accurately reflect a valid value accepted by the Google Cloud Compute Engine API. The resource should be created successfully when using a type value listed in the documentation.

Actual Behavior

When using type = "GENERAL_PURPOSE_N1" as listed in the Terraform provider documentation, the Google Cloud API returns a 503 internal error.

This indicates that GENERAL_PURPOSE_N1 is not a valid type in the backend API. Per Google documentation, GENERAL_PURPOSE should be used if N1 machine types are desired.

Steps to reproduce

  1. Configure the google_compute_region_commitment resource as shown above.
  2. terraform apply

Important Factoids

No response

References

  1. Terraform Provider Documentation: https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_region_commitment#type-1:~:text=%2C%20ACCELERATOR_OPTIMIZED%2C-,GENERAL_PURPOSE_N1,-%2C%20GENERAL_PURPOSE_N2%2C
  2. Google Cloud API documentation for commitments: https://cloud.google.com/compute/docs/reference/rest/v1/regionCommitments
  3. Related closed GitHub Issue: Support more compute types for google_compute_region_commitment #14560 (This issue added several new types, including GENERAL_PURPOSE_N1, to the documentation).

Suggested Correction:

The type GENERAL_PURPOSE_N1 should be removed from the list of valid types in the documentation for the google_compute_region_commitment resource. The correct type for N1 machine series commitments is GENERAL_PURPOSE.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions