Capacity Commitment
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:
How-to Guides
Example Usage
Bigquery Reservation Capacity Commitment Docs
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const example = new gcp.bigquery.CapacityCommitment("example", {
capacityCommitmentId: "example-commitment",
location: "us-west2",
slotCount: 100,
plan: "FLEX_FLAT_RATE",
edition: "ENTERPRISE",
});
import pulumi
import pulumi_gcp as gcp
example = gcp.bigquery.CapacityCommitment("example",
capacity_commitment_id="example-commitment",
location="us-west2",
slot_count=100,
plan="FLEX_FLAT_RATE",
edition="ENTERPRISE")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var example = new Gcp.BigQuery.CapacityCommitment("example", new()
{
CapacityCommitmentId = "example-commitment",
Location = "us-west2",
SlotCount = 100,
Plan = "FLEX_FLAT_RATE",
Edition = "ENTERPRISE",
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/bigquery"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := bigquery.NewCapacityCommitment(ctx, "example", &bigquery.CapacityCommitmentArgs{
CapacityCommitmentId: pulumi.String("example-commitment"),
Location: pulumi.String("us-west2"),
SlotCount: pulumi.Int(100),
Plan: pulumi.String("FLEX_FLAT_RATE"),
Edition: pulumi.String("ENTERPRISE"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.bigquery.CapacityCommitment;
import com.pulumi.gcp.bigquery.CapacityCommitmentArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new CapacityCommitment("example", CapacityCommitmentArgs.builder()
.capacityCommitmentId("example-commitment")
.location("us-west2")
.slotCount(100)
.plan("FLEX_FLAT_RATE")
.edition("ENTERPRISE")
.build());
}
}
resources:
example:
type: gcp:bigquery:CapacityCommitment
properties:
capacityCommitmentId: example-commitment
location: us-west2
slotCount: 100
plan: FLEX_FLAT_RATE
edition: ENTERPRISE
Import
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}}
When using thepulumi import
command, CapacityCommitment can be imported using one of the formats above. For example:
$ pulumi import gcp:bigquery/capacityCommitment:CapacityCommitment default projects/{{project}}/locations/{{location}}/capacityCommitments/{{capacity_commitment_id}}
$ pulumi import gcp:bigquery/capacityCommitment:CapacityCommitment default {{project}}/{{location}}/{{capacity_commitment_id}}
$ pulumi import gcp:bigquery/capacityCommitment:CapacityCommitment default {{location}}/{{capacity_commitment_id}}
Properties
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.
The start of the current commitment period. It is applicable only for ACTIVE capacity commitments.
The start of the current commitment period. It is applicable only for ACTIVE capacity commitments.
If true, fail the request if another project in the organization has a capacity commitment.
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.