UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

125 lines 5.48 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.ReservationAssignment = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * 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 * * ```typescript * 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, * }); * ``` * * ## 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: * * ```sh * $ pulumi import gcp:bigquery/reservationAssignment:ReservationAssignment default projects/{{project}}/locations/{{location}}/reservations/{{reservation}}/assignments/{{name}} * ``` * * ```sh * $ pulumi import gcp:bigquery/reservationAssignment:ReservationAssignment default {{project}}/{{location}}/{{reservation}}/{{name}} * ``` * * ```sh * $ pulumi import gcp:bigquery/reservationAssignment:ReservationAssignment default {{location}}/{{reservation}}/{{name}} * ``` */ class ReservationAssignment extends pulumi.CustomResource { /** * Get an existing ReservationAssignment resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, state, opts) { return new ReservationAssignment(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of ReservationAssignment. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === ReservationAssignment.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["assignee"] = state ? state.assignee : undefined; resourceInputs["jobType"] = state ? state.jobType : undefined; resourceInputs["location"] = state ? state.location : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["project"] = state ? state.project : undefined; resourceInputs["reservation"] = state ? state.reservation : undefined; resourceInputs["state"] = state ? state.state : undefined; } else { const args = argsOrState; if ((!args || args.assignee === undefined) && !opts.urn) { throw new Error("Missing required property 'assignee'"); } if ((!args || args.jobType === undefined) && !opts.urn) { throw new Error("Missing required property 'jobType'"); } if ((!args || args.reservation === undefined) && !opts.urn) { throw new Error("Missing required property 'reservation'"); } resourceInputs["assignee"] = args ? args.assignee : undefined; resourceInputs["jobType"] = args ? args.jobType : undefined; resourceInputs["location"] = args ? args.location : undefined; resourceInputs["project"] = args ? args.project : undefined; resourceInputs["reservation"] = args ? args.reservation : undefined; resourceInputs["name"] = undefined /*out*/; resourceInputs["state"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ReservationAssignment.__pulumiType, name, resourceInputs, opts); } } exports.ReservationAssignment = ReservationAssignment; /** @internal */ ReservationAssignment.__pulumiType = 'gcp:bigquery/reservationAssignment:ReservationAssignment'; //# sourceMappingURL=reservationAssignment.js.map