Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions mmv1/products/bigqueryreservation/ReservationAssignment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ samples:
reservation_name: 'example-reservation'
test_env_vars:
project: 'PROJECT_NAME'
- name: 'bigquery_reservation_assignment_full_with_principal'
primary_resource_id: 'assignment'
exclude_basic_doc: true
steps:
- name: 'bigquery_reservation_assignment_full_with_principal'
resource_id_vars:
reservation_name: 'example-reservation'
test_env_vars:
project: 'PROJECT_NAME'
service_account: 'SERVICE_ACCT'
parameters:
- name: 'location'
type: String
Expand Down Expand Up @@ -91,6 +101,14 @@ properties:
description: |
Types of job, which could be specified when using the reservation. Possible values: JOB_TYPE_UNSPECIFIED, PIPELINE, QUERY, CONTINUOUS
required: true
- name: 'principal'
type: String
description: |
Optional. Represents the principal for this assignment. If not empty, jobs run by this principal will utilize the associated reservation. Otherwise, jobs will fall back to using the reservation assigned to the project, folder, or organization (in that order). If no reservation is assigned at any of these levels, on-demand capacity will be used. The supported formats are:
* `principal://goog/subject/USER_EMAIL_ADDRESS` for users,
* `principal://iam.googleapis.com/projects/-/serviceAccounts/SA_EMAIL_ADDRESS` for service accounts,
* `principal://iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID/subject/SUBJECT_ID` for workload identity pool identities.
* The special value `unknown_or_deleted_user` represents principals which cannot be read from the user info service, for example deleted users.
- name: 'state'
type: String
description: |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
resource "google_bigquery_reservation" "basic" {
name = "{{index $.ResourceIdVars "reservation_name"}}"
project = "{{index $.TestEnvVars "project"}}"
location = "us-central1"
slot_capacity = 0
ignore_idle_slots = false
}

resource "google_bigquery_reservation_assignment" "{{$.PrimaryResourceId}}" {
assignee = "projects/{{index $.TestEnvVars "project"}}"
job_type = "QUERY"
location = "us-central1"
principal = "principal://iam.googleapis.com/projects/-/serviceAccounts/{{index $.TestEnvVars "service_account"}}"
reservation = google_bigquery_reservation.basic.id
}
Loading