A reservation is a mechanism used to guarantee BigQuery slots to users.
To get more information about Reservation, see:
resource "google_bigquery_reservation" "reservation" {
name = "my-reservation"
location = "us-west2"
// Set to 0 for testing purposes
// In reality this would be larger than zero
slot_capacity = 0
edition = "STANDARD"
ignore_idle_slots = true
concurrency = 0
autoscale {
max_slots = 100
}
}
The following arguments are supported:
slot_capacity
-
(Required)
Minimum slots available to this reservation. A slot is a unit of computational power in BigQuery, and serves as the
unit of parallelism. Queries using this reservation might use more slots during runtime if ignoreIdleSlots is set to false.
name
-
(Required)
The name of the reservation. This field must only contain alphanumeric characters or dash.
ignore_idle_slots
-
(Optional)
If false, any query using this reservation will use idle slots from other reservations within
the same admin project. If true, a query using this reservation will execute with the slot
capacity specified above at most.
concurrency
-
(Optional)
Maximum number of queries that are allowed to run concurrently in this reservation. This is a soft limit due to asynchronous nature of the system and various optimizations for small queries. Default value is 0 which means that concurrency will be automatically set based on the reservation size.
multi_region_auxiliary
-
(Optional)
Applicable only for reservations located within one of the BigQuery multi-regions (US or EU).
If set to true, this reservation is placed in the organization's secondary region which is designated for disaster recovery purposes. If false, this reservation is placed in the organization's default region.
edition
-
(Optional)
The edition type. Valid values are STANDARD, ENTERPRISE, ENTERPRISE_PLUS
autoscale
-
(Optional)
The configuration parameters for the auto scaling feature.
Structure is documented below.
location
-
(Optional)
The geographic location where the transfer config should reside.
Examples: US, EU, asia-northeast1. The default value is US.
project
- (Optional) The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.
current_slots
-
(Output)
The slot capacity added to this reservation when autoscale happens. Will be between [0, max_slots].
max_slots
-
(Optional)
Number of slots to be scaled when needed.
In addition to the arguments listed above, the following computed attributes are exported:
id
- an identifier for the resource with format projects/{{project}}/locations/{{location}}/reservations/{{name}}
This resource provides the following Timeouts configuration options:
create
- Default is 20 minutes.update
- Default is 20 minutes.delete
- Default is 20 minutes.Reservation can be imported using any of these accepted formats:
projects/{{project}}/locations/{{location}}/reservations/{{name}}
{{project}}/{{location}}/{{name}}
{{location}}/{{name}}
In Terraform v1.5.0 and later, use an import
block to import Reservation using one of the formats above. For example:
import {
id = "projects/{{project}}/locations/{{location}}/reservations/{{name}}"
to = google_bigquery_reservation.default
}
When using the terraform import
command, Reservation can be imported using one of the formats above. For example:
$ terraform import google_bigquery_reservation.default projects/{{project}}/locations/{{location}}/reservations/{{name}}
$ terraform import google_bigquery_reservation.default {{project}}/{{location}}/{{name}}
$ terraform import google_bigquery_reservation.default {{location}}/{{name}}
This resource supports User Project Overrides.