1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. bigquery
  5. ReservationAssignment
Google Cloud Classic v7.19.0 published on Thursday, Apr 18, 2024 by Pulumi

gcp.bigquery.ReservationAssignment

Explore with Pulumi AI

gcp logo
Google Cloud Classic v7.19.0 published on Thursday, Apr 18, 2024 by Pulumi

    The BigqueryReservation Assignment resource

    Example Usage

    Basic

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const basic = new gcp.bigquery.Reservation("basic", {
        name: "tf-test-my-reservation",
        project: "my-project-name",
        location: "us-central1",
        slotCapacity: 0,
        ignoreIdleSlots: false,
    });
    const primary = new gcp.bigquery.ReservationAssignment("primary", {
        assignee: "projects/my-project-name",
        jobType: "PIPELINE",
        reservation: basic.id,
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    basic = gcp.bigquery.Reservation("basic",
        name="tf-test-my-reservation",
        project="my-project-name",
        location="us-central1",
        slot_capacity=0,
        ignore_idle_slots=False)
    primary = gcp.bigquery.ReservationAssignment("primary",
        assignee="projects/my-project-name",
        job_type="PIPELINE",
        reservation=basic.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v7/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("tf-test-my-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, "primary", &bigquery.ReservationAssignmentArgs{
    			Assignee:    pulumi.String("projects/my-project-name"),
    			JobType:     pulumi.String("PIPELINE"),
    			Reservation: basic.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    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 = "tf-test-my-reservation",
            Project = "my-project-name",
            Location = "us-central1",
            SlotCapacity = 0,
            IgnoreIdleSlots = false,
        });
    
        var primary = new Gcp.BigQuery.ReservationAssignment("primary", new()
        {
            Assignee = "projects/my-project-name",
            JobType = "PIPELINE",
            Reservation = basic.Id,
        });
    
    });
    
    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("tf-test-my-reservation")
                .project("my-project-name")
                .location("us-central1")
                .slotCapacity(0)
                .ignoreIdleSlots(false)
                .build());
    
            var primary = new ReservationAssignment("primary", ReservationAssignmentArgs.builder()        
                .assignee("projects/my-project-name")
                .jobType("PIPELINE")
                .reservation(basic.id())
                .build());
    
        }
    }
    
    resources:
      basic:
        type: gcp:bigquery:Reservation
        properties:
          name: tf-test-my-reservation
          project: my-project-name
          location: us-central1
          slotCapacity: 0
          ignoreIdleSlots: false
      primary:
        type: gcp:bigquery:ReservationAssignment
        properties:
          assignee: projects/my-project-name
          jobType: PIPELINE
          reservation: ${basic.id}
    

    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 string
    The unique name of the resource.
    args ReservationAssignmentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args 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 string
    The unique name of the resource.
    args ReservationAssignmentArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ReservationAssignmentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ReservationAssignmentArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    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",
    });
    
    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"),
    })
    
    var reservationAssignmentResource = new ReservationAssignment("reservationAssignmentResource", ReservationAssignmentArgs.builder()        
        .assignee("string")
        .jobType("string")
        .reservation("string")
        .location("string")
        .project("string")
        .build());
    
    reservation_assignment_resource = gcp.bigquery.ReservationAssignment("reservationAssignmentResource",
        assignee="string",
        job_type="string",
        reservation="string",
        location="string",
        project="string")
    
    const reservationAssignmentResource = new gcp.bigquery.ReservationAssignment("reservationAssignmentResource", {
        assignee: "string",
        jobType: "string",
        reservation: "string",
        location: "string",
        project: "string",
    });
    
    type: gcp:bigquery:ReservationAssignment
    properties:
        assignee: string
        jobType: string
        location: string
        project: string
        reservation: string
    

    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

    The ReservationAssignment resource accepts the following input properties:

    Assignee string
    The resource which will use the reservation. E.g. projects/myproject, folders/123, organizations/456.
    JobType string
    Types of job, which could be specified when using the reservation. Possible values: JOB_TYPE_UNSPECIFIED, PIPELINE, QUERY
    Reservation string
    The reservation for the resource


    Location string
    The location for the resource
    Project string
    The project for the resource
    Assignee string
    The resource which will use the reservation. E.g. projects/myproject, folders/123, organizations/456.
    JobType string
    Types of job, which could be specified when using the reservation. Possible values: JOB_TYPE_UNSPECIFIED, PIPELINE, QUERY
    Reservation string
    The reservation for the resource


    Location string
    The location for the resource
    Project string
    The project for the resource
    assignee String
    The resource which will use the reservation. E.g. projects/myproject, folders/123, organizations/456.
    jobType String
    Types of job, which could be specified when using the reservation. Possible values: JOB_TYPE_UNSPECIFIED, PIPELINE, QUERY
    reservation String
    The reservation for the resource


    location String
    The location for the resource
    project String
    The project for the resource
    assignee string
    The resource which will use the reservation. E.g. projects/myproject, folders/123, organizations/456.
    jobType string
    Types of job, which could be specified when using the reservation. Possible values: JOB_TYPE_UNSPECIFIED, PIPELINE, QUERY
    reservation string
    The reservation for the resource


    location string
    The location for the resource
    project string
    The project for the resource
    assignee str
    The resource which will use the reservation. E.g. projects/myproject, folders/123, organizations/456.
    job_type str
    Types of job, which could be specified when using the reservation. Possible values: JOB_TYPE_UNSPECIFIED, PIPELINE, QUERY
    reservation str
    The reservation for the resource


    location str
    The location for the resource
    project str
    The project for the resource
    assignee String
    The resource which will use the reservation. E.g. projects/myproject, folders/123, organizations/456.
    jobType String
    Types of job, which could be specified when using the reservation. Possible values: JOB_TYPE_UNSPECIFIED, PIPELINE, QUERY
    reservation String
    The reservation for the resource


    location String
    The location for the resource
    project String
    The project for the resource

    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)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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 string
    The resource which will use the reservation. E.g. projects/myproject, folders/123, organizations/456.
    JobType string
    Types of job, which could be specified when using the reservation. Possible values: JOB_TYPE_UNSPECIFIED, PIPELINE, QUERY
    Location string
    The location for the resource
    Name string
    Output only. The resource name of the assignment.
    Project string
    The project for the resource
    Reservation 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 string
    The resource which will use the reservation. E.g. projects/myproject, folders/123, organizations/456.
    JobType string
    Types of job, which could be specified when using the reservation. Possible values: JOB_TYPE_UNSPECIFIED, PIPELINE, QUERY
    Location string
    The location for the resource
    Name string
    Output only. The resource name of the assignment.
    Project string
    The project for the resource
    Reservation 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 String
    The resource which will use the reservation. E.g. projects/myproject, folders/123, organizations/456.
    jobType String
    Types of job, which could be specified when using the reservation. Possible values: JOB_TYPE_UNSPECIFIED, PIPELINE, QUERY
    location String
    The location for the resource
    name String
    Output only. The resource name of the assignment.
    project String
    The project for the resource
    reservation 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 string
    The resource which will use the reservation. E.g. projects/myproject, folders/123, organizations/456.
    jobType string
    Types of job, which could be specified when using the reservation. Possible values: JOB_TYPE_UNSPECIFIED, PIPELINE, QUERY
    location string
    The location for the resource
    name string
    Output only. The resource name of the assignment.
    project string
    The project for the resource
    reservation 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 str
    The resource which will use the reservation. E.g. projects/myproject, folders/123, organizations/456.
    job_type str
    Types of job, which could be specified when using the reservation. Possible values: JOB_TYPE_UNSPECIFIED, PIPELINE, QUERY
    location str
    The location for the resource
    name str
    Output only. The resource name of the assignment.
    project str
    The project for the resource
    reservation 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 String
    The resource which will use the reservation. E.g. projects/myproject, folders/123, organizations/456.
    jobType String
    Types of job, which could be specified when using the reservation. Possible values: JOB_TYPE_UNSPECIFIED, PIPELINE, QUERY
    location String
    The location for the resource
    name String
    Output only. The resource name of the assignment.
    project String
    The project for the resource
    reservation 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

    Assignment 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, Assignment 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}}
    
    $ pulumi import gcp:bigquery/reservationAssignment:ReservationAssignment default {{project}}/{{location}}/{{reservation}}/{{name}}
    
    $ pulumi import gcp:bigquery/reservationAssignment:ReservationAssignment default {{location}}/{{reservation}}/{{name}}
    

    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.
    gcp logo
    Google Cloud Classic v7.19.0 published on Thursday, Apr 18, 2024 by Pulumi