1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. bigquery
  5. ReservationAssignment
Google Cloud v8.27.1 published on Friday, Apr 25, 2025 by Pulumi

gcp.bigquery.ReservationAssignment

Explore with Pulumi AI

The BigqueryReservation Assignment resource.

To get more information about ReservationAssignment, see:

Example Usage

Bigquery Reservation Assignment Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const basic = new gcp.bigquery.Reservation("basic", {
    name: "example-reservation",
    project: "my-project-name",
    location: "us-central1",
    slotCapacity: 0,
    ignoreIdleSlots: false,
});
const assignment = new gcp.bigquery.ReservationAssignment("assignment", {
    assignee: "projects/my-project-name",
    jobType: "PIPELINE",
    reservation: basic.id,
});
Copy
import pulumi
import pulumi_gcp as gcp

basic = gcp.bigquery.Reservation("basic",
    name="example-reservation",
    project="my-project-name",
    location="us-central1",
    slot_capacity=0,
    ignore_idle_slots=False)
assignment = gcp.bigquery.ReservationAssignment("assignment",
    assignee="projects/my-project-name",
    job_type="PIPELINE",
    reservation=basic.id)
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/bigquery"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		basic, err := bigquery.NewReservation(ctx, "basic", &bigquery.ReservationArgs{
			Name:            pulumi.String("example-reservation"),
			Project:         pulumi.String("my-project-name"),
			Location:        pulumi.String("us-central1"),
			SlotCapacity:    pulumi.Int(0),
			IgnoreIdleSlots: pulumi.Bool(false),
		})
		if err != nil {
			return err
		}
		_, err = bigquery.NewReservationAssignment(ctx, "assignment", &bigquery.ReservationAssignmentArgs{
			Assignee:    pulumi.String("projects/my-project-name"),
			JobType:     pulumi.String("PIPELINE"),
			Reservation: basic.ID(),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var basic = new Gcp.BigQuery.Reservation("basic", new()
    {
        Name = "example-reservation",
        Project = "my-project-name",
        Location = "us-central1",
        SlotCapacity = 0,
        IgnoreIdleSlots = false,
    });

    var assignment = new Gcp.BigQuery.ReservationAssignment("assignment", new()
    {
        Assignee = "projects/my-project-name",
        JobType = "PIPELINE",
        Reservation = basic.Id,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.bigquery.Reservation;
import com.pulumi.gcp.bigquery.ReservationArgs;
import com.pulumi.gcp.bigquery.ReservationAssignment;
import com.pulumi.gcp.bigquery.ReservationAssignmentArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var basic = new Reservation("basic", ReservationArgs.builder()
            .name("example-reservation")
            .project("my-project-name")
            .location("us-central1")
            .slotCapacity(0)
            .ignoreIdleSlots(false)
            .build());

        var assignment = new ReservationAssignment("assignment", ReservationAssignmentArgs.builder()
            .assignee("projects/my-project-name")
            .jobType("PIPELINE")
            .reservation(basic.id())
            .build());

    }
}
Copy
resources:
  basic:
    type: gcp:bigquery:Reservation
    properties:
      name: example-reservation
      project: my-project-name
      location: us-central1
      slotCapacity: 0
      ignoreIdleSlots: false
  assignment:
    type: gcp:bigquery:ReservationAssignment
    properties:
      assignee: projects/my-project-name
      jobType: PIPELINE
      reservation: ${basic.id}
Copy

Create ReservationAssignment Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new ReservationAssignment(name: string, args: ReservationAssignmentArgs, opts?: CustomResourceOptions);
@overload
def ReservationAssignment(resource_name: str,
                          args: ReservationAssignmentArgs,
                          opts: Optional[ResourceOptions] = None)

@overload
def ReservationAssignment(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          assignee: Optional[str] = None,
                          job_type: Optional[str] = None,
                          reservation: Optional[str] = None,
                          location: Optional[str] = None,
                          project: Optional[str] = None)
func NewReservationAssignment(ctx *Context, name string, args ReservationAssignmentArgs, opts ...ResourceOption) (*ReservationAssignment, error)
public ReservationAssignment(string name, ReservationAssignmentArgs args, CustomResourceOptions? opts = null)
public ReservationAssignment(String name, ReservationAssignmentArgs args)
public ReservationAssignment(String name, ReservationAssignmentArgs args, CustomResourceOptions options)
type: gcp:bigquery:ReservationAssignment
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ReservationAssignmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ReservationAssignmentArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ReservationAssignmentArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ReservationAssignmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ReservationAssignmentArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var reservationAssignmentResource = new Gcp.BigQuery.ReservationAssignment("reservationAssignmentResource", new()
{
    Assignee = "string",
    JobType = "string",
    Reservation = "string",
    Location = "string",
    Project = "string",
});
Copy
example, err := bigquery.NewReservationAssignment(ctx, "reservationAssignmentResource", &bigquery.ReservationAssignmentArgs{
	Assignee:    pulumi.String("string"),
	JobType:     pulumi.String("string"),
	Reservation: pulumi.String("string"),
	Location:    pulumi.String("string"),
	Project:     pulumi.String("string"),
})
Copy
var reservationAssignmentResource = new ReservationAssignment("reservationAssignmentResource", ReservationAssignmentArgs.builder()
    .assignee("string")
    .jobType("string")
    .reservation("string")
    .location("string")
    .project("string")
    .build());
Copy
reservation_assignment_resource = gcp.bigquery.ReservationAssignment("reservationAssignmentResource",
    assignee="string",
    job_type="string",
    reservation="string",
    location="string",
    project="string")
Copy
const reservationAssignmentResource = new gcp.bigquery.ReservationAssignment("reservationAssignmentResource", {
    assignee: "string",
    jobType: "string",
    reservation: "string",
    location: "string",
    project: "string",
});
Copy
type: gcp:bigquery:ReservationAssignment
properties:
    assignee: string
    jobType: string
    location: string
    project: string
    reservation: string
Copy

ReservationAssignment Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The ReservationAssignment resource accepts the following input properties:

Assignee
This property is required.
Changes to this property will trigger replacement.
string
The resource which will use the reservation. E.g. projects/myproject, folders/123, organizations/456.
JobType
This property is required.
Changes to this property will trigger replacement.
string
Types of job, which could be specified when using the reservation. Possible values: JOB_TYPE_UNSPECIFIED, PIPELINE, QUERY, CONTINUOUS
Reservation
This property is required.
Changes to this property will trigger replacement.
string
The reservation for the resource


Location Changes to this property will trigger replacement. string
The location for the resource
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Assignee
This property is required.
Changes to this property will trigger replacement.
string
The resource which will use the reservation. E.g. projects/myproject, folders/123, organizations/456.
JobType
This property is required.
Changes to this property will trigger replacement.
string
Types of job, which could be specified when using the reservation. Possible values: JOB_TYPE_UNSPECIFIED, PIPELINE, QUERY, CONTINUOUS
Reservation
This property is required.
Changes to this property will trigger replacement.
string
The reservation for the resource


Location Changes to this property will trigger replacement. string
The location for the resource
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
assignee
This property is required.
Changes to this property will trigger replacement.
String
The resource which will use the reservation. E.g. projects/myproject, folders/123, organizations/456.
jobType
This property is required.
Changes to this property will trigger replacement.
String
Types of job, which could be specified when using the reservation. Possible values: JOB_TYPE_UNSPECIFIED, PIPELINE, QUERY, CONTINUOUS
reservation
This property is required.
Changes to this property will trigger replacement.
String
The reservation for the resource


location Changes to this property will trigger replacement. String
The location for the resource
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
assignee
This property is required.
Changes to this property will trigger replacement.
string
The resource which will use the reservation. E.g. projects/myproject, folders/123, organizations/456.
jobType
This property is required.
Changes to this property will trigger replacement.
string
Types of job, which could be specified when using the reservation. Possible values: JOB_TYPE_UNSPECIFIED, PIPELINE, QUERY, CONTINUOUS
reservation
This property is required.
Changes to this property will trigger replacement.
string
The reservation for the resource


location Changes to this property will trigger replacement. string
The location for the resource
project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
assignee
This property is required.
Changes to this property will trigger replacement.
str
The resource which will use the reservation. E.g. projects/myproject, folders/123, organizations/456.
job_type
This property is required.
Changes to this property will trigger replacement.
str
Types of job, which could be specified when using the reservation. Possible values: JOB_TYPE_UNSPECIFIED, PIPELINE, QUERY, CONTINUOUS
reservation
This property is required.
Changes to this property will trigger replacement.
str
The reservation for the resource


location Changes to this property will trigger replacement. str
The location for the resource
project Changes to this property will trigger replacement. str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
assignee
This property is required.
Changes to this property will trigger replacement.
String
The resource which will use the reservation. E.g. projects/myproject, folders/123, organizations/456.
jobType
This property is required.
Changes to this property will trigger replacement.
String
Types of job, which could be specified when using the reservation. Possible values: JOB_TYPE_UNSPECIFIED, PIPELINE, QUERY, CONTINUOUS
reservation
This property is required.
Changes to this property will trigger replacement.
String
The reservation for the resource


location Changes to this property will trigger replacement. String
The location for the resource
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Outputs

All input properties are implicitly available as output properties. Additionally, the ReservationAssignment resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Name string
Output only. The resource name of the assignment.
State string
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
Id string
The provider-assigned unique ID for this managed resource.
Name string
Output only. The resource name of the assignment.
State string
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
id String
The provider-assigned unique ID for this managed resource.
name String
Output only. The resource name of the assignment.
state String
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
id string
The provider-assigned unique ID for this managed resource.
name string
Output only. The resource name of the assignment.
state string
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
id str
The provider-assigned unique ID for this managed resource.
name str
Output only. The resource name of the assignment.
state str
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
id String
The provider-assigned unique ID for this managed resource.
name String
Output only. The resource name of the assignment.
state String
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

Look up Existing ReservationAssignment Resource

Get an existing ReservationAssignment resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ReservationAssignmentState, opts?: CustomResourceOptions): ReservationAssignment
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        assignee: Optional[str] = None,
        job_type: Optional[str] = None,
        location: Optional[str] = None,
        name: Optional[str] = None,
        project: Optional[str] = None,
        reservation: Optional[str] = None,
        state: Optional[str] = None) -> ReservationAssignment
func GetReservationAssignment(ctx *Context, name string, id IDInput, state *ReservationAssignmentState, opts ...ResourceOption) (*ReservationAssignment, error)
public static ReservationAssignment Get(string name, Input<string> id, ReservationAssignmentState? state, CustomResourceOptions? opts = null)
public static ReservationAssignment get(String name, Output<String> id, ReservationAssignmentState state, CustomResourceOptions options)
resources:  _:    type: gcp:bigquery:ReservationAssignment    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Assignee Changes to this property will trigger replacement. string
The resource which will use the reservation. E.g. projects/myproject, folders/123, organizations/456.
JobType Changes to this property will trigger replacement. string
Types of job, which could be specified when using the reservation. Possible values: JOB_TYPE_UNSPECIFIED, PIPELINE, QUERY, CONTINUOUS
Location Changes to this property will trigger replacement. string
The location for the resource
Name string
Output only. The resource name of the assignment.
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Reservation Changes to this property will trigger replacement. string
The reservation for the resource


State string
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
Assignee Changes to this property will trigger replacement. string
The resource which will use the reservation. E.g. projects/myproject, folders/123, organizations/456.
JobType Changes to this property will trigger replacement. string
Types of job, which could be specified when using the reservation. Possible values: JOB_TYPE_UNSPECIFIED, PIPELINE, QUERY, CONTINUOUS
Location Changes to this property will trigger replacement. string
The location for the resource
Name string
Output only. The resource name of the assignment.
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Reservation Changes to this property will trigger replacement. string
The reservation for the resource


State string
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
assignee Changes to this property will trigger replacement. String
The resource which will use the reservation. E.g. projects/myproject, folders/123, organizations/456.
jobType Changes to this property will trigger replacement. String
Types of job, which could be specified when using the reservation. Possible values: JOB_TYPE_UNSPECIFIED, PIPELINE, QUERY, CONTINUOUS
location Changes to this property will trigger replacement. String
The location for the resource
name String
Output only. The resource name of the assignment.
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
reservation Changes to this property will trigger replacement. String
The reservation for the resource


state String
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
assignee Changes to this property will trigger replacement. string
The resource which will use the reservation. E.g. projects/myproject, folders/123, organizations/456.
jobType Changes to this property will trigger replacement. string
Types of job, which could be specified when using the reservation. Possible values: JOB_TYPE_UNSPECIFIED, PIPELINE, QUERY, CONTINUOUS
location Changes to this property will trigger replacement. string
The location for the resource
name string
Output only. The resource name of the assignment.
project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
reservation Changes to this property will trigger replacement. string
The reservation for the resource


state string
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
assignee Changes to this property will trigger replacement. str
The resource which will use the reservation. E.g. projects/myproject, folders/123, organizations/456.
job_type Changes to this property will trigger replacement. str
Types of job, which could be specified when using the reservation. Possible values: JOB_TYPE_UNSPECIFIED, PIPELINE, QUERY, CONTINUOUS
location Changes to this property will trigger replacement. str
The location for the resource
name str
Output only. The resource name of the assignment.
project Changes to this property will trigger replacement. str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
reservation Changes to this property will trigger replacement. str
The reservation for the resource


state str
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
assignee Changes to this property will trigger replacement. String
The resource which will use the reservation. E.g. projects/myproject, folders/123, organizations/456.
jobType Changes to this property will trigger replacement. String
Types of job, which could be specified when using the reservation. Possible values: JOB_TYPE_UNSPECIFIED, PIPELINE, QUERY, CONTINUOUS
location Changes to this property will trigger replacement. String
The location for the resource
name String
Output only. The resource name of the assignment.
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
reservation Changes to this property will trigger replacement. String
The reservation for the resource


state String
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

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}}

When using the pulumi import command, ReservationAssignment can be imported using one of the formats above. For example:

$ pulumi import gcp:bigquery/reservationAssignment:ReservationAssignment default projects/{{project}}/locations/{{location}}/reservations/{{reservation}}/assignments/{{name}}
Copy
$ pulumi import gcp:bigquery/reservationAssignment:ReservationAssignment default {{project}}/{{location}}/{{reservation}}/{{name}}
Copy
$ pulumi import gcp:bigquery/reservationAssignment:ReservationAssignment default {{location}}/{{reservation}}/{{name}}
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Google Cloud (GCP) Classic pulumi/pulumi-gcp
License
Apache-2.0
Notes
This Pulumi package is based on the google-beta Terraform Provider.