| --- |
| # ---------------------------------------------------------------------------- |
| # |
| # *** AUTO GENERATED CODE *** Type: MMv1 *** |
| # |
| # ---------------------------------------------------------------------------- |
| # |
| # This file is automatically generated by Magic Modules and manual |
| # changes will be clobbered when the file is regenerated. |
| # |
| # Please read more about how to change this file in |
| # .github/CONTRIBUTING.md. |
| # |
| # ---------------------------------------------------------------------------- |
| subcategory: "BigQuery Reservation" |
| description: |- |
| A reservation is a mechanism used to guarantee BigQuery slots to users. |
| --- |
| |
| # google\_bigquery\_reservation |
| |
| A reservation is a mechanism used to guarantee BigQuery slots to users. |
| |
| |
| To get more information about Reservation, see: |
| |
| * [API documentation](https://cloud.google.com/bigquery/docs/reference/reservations/rest/v1/projects.locations.reservations/create) |
| * How-to Guides |
| * [Introduction to Reservations](https://cloud.google.com/bigquery/docs/reservations-intro) |
| |
| <div class = "oics-button" style="float: right; margin: 0 0 -15px"> |
| <a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=bigquery_reservation_basic&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" target="_blank"> |
| <img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;"> |
| </a> |
| </div> |
| ## Example Usage - Bigquery Reservation Basic |
| |
| |
| ```hcl |
| 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 |
| } |
| } |
| ``` |
| |
| ## Argument Reference |
| |
| 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](#nested_autoscale). |
| |
| * `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. |
| |
| |
| <a name="nested_autoscale"></a>The `autoscale` block supports: |
| |
| * `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. |
| |
| ## Attributes Reference |
| |
| 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}}` |
| |
| |
| ## Timeouts |
| |
| This resource provides the following |
| [Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) configuration options: |
| |
| - `create` - Default is 20 minutes. |
| - `update` - Default is 20 minutes. |
| - `delete` - Default is 20 minutes. |
| |
| ## Import |
| |
| |
| 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](https://developer.hashicorp.com/terraform/language/import) to import Reservation using one of the formats above. For example: |
| |
| ```tf |
| import { |
| id = "projects/{{project}}/locations/{{location}}/reservations/{{name}}" |
| to = google_bigquery_reservation.default |
| } |
| ``` |
| |
| When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), 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}} |
| ``` |
| |
| ## User Project Overrides |
| |
| This resource supports [User Project Overrides](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference#user_project_override). |