google_compute_region_commitment

Represents a regional Commitment resource.

Creating a commitment resource means that you are purchasing a committed use contract with an explicit start and end time. You can create commitments based on vCPUs and memory usage and receive discounted rates.

To get more information about RegionCommitment, see:

Example Usage - Compute Region Commitment Basic

resource "google_compute_region_commitment" "foobar" {
  name = "my-region-commitment"
  plan = "THIRTY_SIX_MONTH"
  resources {
      type = "VCPU"
      amount = "4"
  }
  resources {
      type = "MEMORY"
      amount = "9"
  }
}

Example Usage - Compute Region Commitment Full

resource "google_compute_region_commitment" "foobar" {
  name = "my-full-commitment"
  description = "some description"
  plan = "THIRTY_SIX_MONTH"
  type = "MEMORY_OPTIMIZED"
  category = "MACHINE"
  auto_renew = true
  resources {
      type = "VCPU"
      amount = "4"
  }
  resources {
      type = "MEMORY"
      amount = "9"
  }
}

Argument Reference

The following arguments are supported:


The resources block supports:

The license_resource block supports:

Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

Timeouts

This resource provides the following Timeouts configuration options:

Import

RegionCommitment can be imported using any of these accepted formats:

In Terraform v1.5.0 and later, use an import block to import RegionCommitment using one of the formats above. For example:

import {
  id = "projects/{{project}}/regions/{{region}}/commitments/{{name}}"
  to = google_compute_region_commitment.default
}

When using the terraform import command, RegionCommitment can be imported using one of the formats above. For example:

$ terraform import google_compute_region_commitment.default projects/{{project}}/regions/{{region}}/commitments/{{name}}
$ terraform import google_compute_region_commitment.default {{project}}/{{region}}/{{name}}
$ terraform import google_compute_region_commitment.default {{region}}/{{name}}
$ terraform import google_compute_region_commitment.default {{name}}

User Project Overrides

This resource supports User Project Overrides.