blob: 23909fa9041ea7830bfd868123321ef33703fcd6 [file] [log] [blame] [edit]
---
# ----------------------------------------------------------------------------
#
# *** 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: |-
The BigqueryReservation Assignment resource.
---
# google_bigquery_reservation_assignment
The BigqueryReservation Assignment resource.
To get more information about ReservationAssignment, see:
* [API documentation](https://cloud.google.com/bigquery/docs/reference/reservations/rest/v1/projects.locations.reservations.assignments)
* How-to Guides
* [Work with reservation assignments](https://cloud.google.com/bigquery/docs/reservations-assignments)
## Example Usage - Bigquery Reservation Assignment Basic
```hcl
resource "google_bigquery_reservation" "basic" {
name = "example-reservation"
project = "my-project-name"
location = "us-central1"
slot_capacity = 0
ignore_idle_slots = false
}
resource "google_bigquery_reservation_assignment" "assignment" {
assignee = "projects/my-project-name"
job_type = "PIPELINE"
reservation = google_bigquery_reservation.basic.id
}
```
## Argument Reference
The following arguments are supported:
* `assignee` -
(Required)
The resource which will use the reservation. E.g. projects/myproject, folders/123, organizations/456.
* `job_type` -
(Required)
Types of job, which could be specified when using the reservation. Possible values: JOB_TYPE_UNSPECIFIED, PIPELINE, QUERY
* `reservation` -
(Required)
The reservation for the resource
- - -
* `location` -
(Optional)
The location for the resource
* `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 `projects/{{project}}/locations/{{location}}/reservations/{{reservation}}/assignments/{{name}}`
* `name` -
Output only. The resource name of the assignment.
* `state` -
Assignment will remain in PENDING state if no active capacity commitment is present. It will become ACTIVE when some capacity commitment becomes active.
Possible values: STATE_UNSPECIFIED, PENDING, ACTIVE
## 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.
- `delete` - Default is 20 minutes.
## Import
ReservationAssignment can be imported using any of these accepted formats:
* `projects/{{project}}/locations/{{location}}/reservations/{{reservation}}/assignments/{{name}}`
* `{{project}}/{{location}}/{{reservation}}/{{name}}`
* `{{location}}/{{reservation}}/{{name}}`
In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import ReservationAssignment using one of the formats above. For example:
```tf
import {
id = "projects/{{project}}/locations/{{location}}/reservations/{{reservation}}/assignments/{{name}}"
to = google_bigquery_reservation_assignment.default
}
```
When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), ReservationAssignment can be imported using one of the formats above. For example:
```
$ terraform import google_bigquery_reservation_assignment.default projects/{{project}}/locations/{{location}}/reservations/{{reservation}}/assignments/{{name}}
$ terraform import google_bigquery_reservation_assignment.default {{project}}/{{location}}/{{reservation}}/{{name}}
$ terraform import google_bigquery_reservation_assignment.default {{location}}/{{reservation}}/{{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).