UNPKG

@pulumi/gcp

Version:

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

142 lines 6.32 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.ReservationAssignment = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(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}} * $ pulumi import gcp:bigquery/reservationAssignment:ReservationAssignment default {{project}}/{{location}}/{{reservation}}/{{name}} * $ 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, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'gcp:bigquery/reservationAssignment:ReservationAssignment'; /** * 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?.assignee; resourceInputs["deletionPolicy"] = state?.deletionPolicy; resourceInputs["jobType"] = state?.jobType; resourceInputs["location"] = state?.location; resourceInputs["name"] = state?.name; resourceInputs["project"] = state?.project; resourceInputs["reservation"] = state?.reservation; resourceInputs["state"] = state?.state; } else { const args = argsOrState; if (args?.assignee === undefined && !opts.urn) { throw new Error("Missing required property 'assignee'"); } if (args?.jobType === undefined && !opts.urn) { throw new Error("Missing required property 'jobType'"); } if (args?.reservation === undefined && !opts.urn) { throw new Error("Missing required property 'reservation'"); } resourceInputs["assignee"] = args?.assignee; resourceInputs["deletionPolicy"] = args?.deletionPolicy; resourceInputs["jobType"] = args?.jobType; resourceInputs["location"] = args?.location; resourceInputs["project"] = args?.project; resourceInputs["reservation"] = args?.reservation; resourceInputs["name"] = undefined /*out*/; resourceInputs["state"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ReservationAssignment.__pulumiType, name, resourceInputs, opts); } } exports.ReservationAssignment = ReservationAssignment; //# sourceMappingURL=reservationAssignment.js.map