Capacity commitment is a way to purchase compute capacity for BigQuery jobs (in the form of slots) with some committed period of usage. Annual commitments renew by default. Commitments can be removed after their commitment end time passes.
In order to remove annual commitment, its plan needs to be changed to monthly or flex first.
To get more information about CapacityCommitment, see:
resource "google_bigquery_capacity_commitment" "example" {
capacity_commitment_id = "example-commitment"
location = "us-west2"
slot_count = 100
plan = "FLEX_FLAT_RATE"
edition = "ENTERPRISE"
}
The following arguments are supported:
slot_count
-
(Required)
Number of slots in this commitment.
plan
-
(Required)
Capacity commitment plan. Valid values are at https://cloud.google.com/bigquery/docs/reference/reservations/rpc/google.cloud.bigquery.reservation.v1#commitmentplan
renewal_plan
-
(Optional)
The plan this capacity commitment is converted to after commitmentEndTime passes. Once the plan is changed, committed period is extended according to commitment plan. Only applicable for some commitment plans.
edition
-
(Optional)
The edition type. Valid values are STANDARD, ENTERPRISE, ENTERPRISE_PLUS
capacity_commitment_id
-
(Optional)
The optional capacity commitment ID. Capacity commitment name will be generated automatically if this field is
empty. This field must only contain lower case alphanumeric characters or dashes. The first and last character
cannot be a dash. Max length is 64 characters. NOTE: this ID won't be kept if the capacity commitment is split
or merged.
location
-
(Optional)
The geographic location where the transfer config should reside.
Examples: US, EU, asia-northeast1. The default value is US.
enforce_single_admin_project_per_org
-
(Optional)
If true, fail the request if another project in the organization has a capacity commitment.
project
- (Optional) The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.
In addition to the arguments listed above, the following computed attributes are exported:
id
- an identifier for the resource with format {{name}}
name
-
The resource name of the capacity commitment, e.g., projects/myproject/locations/US/capacityCommitments/123
state
-
State of the commitment
commitment_start_time
-
The start of the current commitment period. It is applicable only for ACTIVE capacity commitments.
commitment_end_time
-
The start of the current commitment period. It is applicable only for ACTIVE capacity commitments.
This resource provides the following Timeouts configuration options:
create
- Default is 20 minutes.update
- Default is 20 minutes.delete
- Default is 20 minutes.CapacityCommitment can be imported using any of these accepted formats:
projects/{{project}}/locations/{{location}}/capacityCommitments/{{capacity_commitment_id}}
{{project}}/{{location}}/{{capacity_commitment_id}}
{{location}}/{{capacity_commitment_id}}
In Terraform v1.5.0 and later, use an import
block to import CapacityCommitment using one of the formats above. For example:
import {
id = "projects/{{project}}/locations/{{location}}/capacityCommitments/{{capacity_commitment_id}}"
to = google_bigquery_capacity_commitment.default
}
When using the terraform import
command, CapacityCommitment can be imported using one of the formats above. For example:
$ terraform import google_bigquery_capacity_commitment.default projects/{{project}}/locations/{{location}}/capacityCommitments/{{capacity_commitment_id}}
$ terraform import google_bigquery_capacity_commitment.default {{project}}/{{location}}/{{capacity_commitment_id}}
$ terraform import google_bigquery_capacity_commitment.default {{location}}/{{capacity_commitment_id}}
This resource supports User Project Overrides.