GCP.BigQueryReservation reference
Assignment
Section titled “Assignment”Source:
src/GCP/BigQueryReservation/Assignment.ts
A BigQuery reservation assignment — grants a project, folder, or
organization slots from a Reservation for one job type.
Assignments have no labels. Alchemy stamps ownership into
assignmentId so list / pnpm nuke:gcp can find them. Changing
reservation, assignee, jobType, location, or assignmentId
replaces the assignment. principal and schedulingPolicy update
in place.
Assignment: Creating an Assignment
Section titled “Assignment: Creating an Assignment”Assign QUERY jobs in this project
const slots = yield* GCP.BigQueryReservation.Reservation("Slots", {});const assignment = yield* GCP.BigQueryReservation.Assignment("Query", { reservation: slots.name, jobType: "QUERY",});None assignment (on-demand)
const none = yield* GCP.BigQueryReservation.Assignment("OnDemand", { reservation: "none", location: "US", jobType: "QUERY",});CapacityCommitment
Section titled “CapacityCommitment”Source:
src/GCP/BigQueryReservation/CapacityCommitment.ts
A BigQuery capacity commitment — purchased slot capacity with a committed period of usage.
Commitments have no labels, so Alchemy stamps ownership into the
commitment id (alch---…) so list / pnpm nuke:gcp can find them.
Changing capacityCommitmentId, location, slotCount, edition,
or multiRegionAuxiliary replaces the commitment. plan and
renewalPlan update in place (plan can only lengthen).
FLEX commitments can be deleted about 60 seconds after they become
ACTIVE. Annual and three-year commitments cannot be deleted until
they expire.
CapacityCommitment: Creating a Capacity Commitment
Section titled “CapacityCommitment: Creating a Capacity Commitment”Flex Enterprise slots
const commit = yield* GCP.BigQueryReservation.CapacityCommitment("Flex", { location: "US", slotCount: "50", plan: "FLEX_FLAT_RATE", edition: "ENTERPRISE",});Annual commitment with flex renewal
const commit = yield* GCP.BigQueryReservation.CapacityCommitment("Year", { location: "US", slotCount: "100", plan: "ANNUAL", renewalPlan: "FLEX", edition: "ENTERPRISE",});Reservation
Section titled “Reservation”Source:
src/GCP/BigQueryReservation/Reservation.ts
A BigQuery slot reservation — a named pool of slots that assignments can consume.
Changing reservationId, location, edition, or
multiRegionAuxiliary replaces the reservation. Baseline capacity,
idle-slot behavior, labels, autoscale, and failover location are
updated in place.
Reservation: Creating a Reservation
Section titled “Reservation: Creating a Reservation”Generated name, zero-slot ENTERPRISE
const slots = yield* GCP.BigQueryReservation.Reservation("Slots", {});Explicit id, labels, and idle-slot isolation
const slots = yield* GCP.BigQueryReservation.Reservation("Slots", { reservationId: "analytics-prod", location: "us-central1", edition: "ENTERPRISE", slotCapacity: "0", ignoreIdleSlots: false, labels: { env: "prod" },});STANDARD with autoscale
const slots = yield* GCP.BigQueryReservation.Reservation("Slots", { location: "US", edition: "STANDARD", ignoreIdleSlots: true, autoscale: { maxSlots: "50" },});ReservationGroup
Section titled “ReservationGroup”Source:
src/GCP/BigQueryReservation/ReservationGroup.ts
A BigQuery reservation group — a named container for reservations.
Groups have no labels or description, so Alchemy stamps ownership into
the group id (alch---…) so list / pnpm nuke:gcp can find them.
There is no update API; reservationGroupId and location are
identity and changing them replaces the group.
ReservationGroup: Creating a Reservation Group
Section titled “ReservationGroup: Creating a Reservation Group”Generated id
const group = yield* GCP.BigQueryReservation.ReservationGroup("Team", {});Explicit id and multi-region location
const group = yield* GCP.BigQueryReservation.ReservationGroup("Team", { reservationGroupId: "analytics-prod", location: "US",});