Skip to content

googleBigqueryCapacityCommitment

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:

Example Usage - Bigquery Reservation Capacity Commitment Docs

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
new google.bigqueryCapacityCommitment.BigqueryCapacityCommitment(
  this,
  "example",
  {
    capacity_commitment_id: "example-commitment",
    location: "us-west1",
    plan: "FLEX",
    slot_count: 100,
  }
);

Argument Reference

The following arguments are supported:

  • slotCount - (Required) Number of slots in this commitment.

  • plan - (Required) Capacity commitment plan. Valid values are FLEX, TRIAL, MONTHLY, ANNUAL


  • renewalPlan - (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 ANNUAL and TRIAL commitments.

  • capacityCommitmentId - (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.

  • enforceSingleAdminProjectPerOrg - (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.

Attributes Reference

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

  • commitmentStartTime - The start of the current commitment period. It is applicable only for ACTIVE capacity commitments.

  • commitmentEndTime - The start of the current commitment period. It is applicable only for ACTIVE capacity commitments.

Timeouts

This resource provides the following Timeouts configuration options:

  • create - Default is 20 minutes.
  • update - Default is 20 minutes.
  • delete - Default is 20 minutes.

Import

CapacityCommitment can be imported using any of these accepted formats:

$ terraform import google_bigquery_capacity_commitment.default {{name}}

User Project Overrides

This resource supports User Project Overrides.