@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
113 lines • 4.42 kB
JavaScript
;
// *** 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.LiteReservation = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* A named resource representing a shared pool of capacity.
*
* To get more information about Reservation, see:
*
* * [API documentation](https://cloud.google.com/pubsub/lite/docs/reference/rest/v1/admin.projects.locations.reservations)
* * How-to Guides
* * [Managing Reservations](https://cloud.google.com/pubsub/lite/docs/reservations)
*
* ## Example Usage
*
* ### Pubsub Lite Reservation Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const project = gcp.organizations.getProject({});
* const example = new gcp.pubsub.LiteReservation("example", {
* name: "example-reservation",
* project: project.then(project => project.number),
* throughputCapacity: 2,
* });
* ```
*
* ## Import
*
* Reservation can be imported using any of these accepted formats:
*
* * `projects/{{project}}/locations/{{region}}/reservations/{{name}}`
*
* * `{{project}}/{{region}}/{{name}}`
*
* * `{{region}}/{{name}}`
*
* * `{{name}}`
*
* When using the `pulumi import` command, Reservation can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:pubsub/liteReservation:LiteReservation default projects/{{project}}/locations/{{region}}/reservations/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:pubsub/liteReservation:LiteReservation default {{project}}/{{region}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:pubsub/liteReservation:LiteReservation default {{region}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:pubsub/liteReservation:LiteReservation default {{name}}
* ```
*/
class LiteReservation extends pulumi.CustomResource {
/**
* Get an existing LiteReservation 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 LiteReservation(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of LiteReservation. 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'] === LiteReservation.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["throughputCapacity"] = state ? state.throughputCapacity : undefined;
}
else {
const args = argsOrState;
if ((!args || args.throughputCapacity === undefined) && !opts.urn) {
throw new Error("Missing required property 'throughputCapacity'");
}
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["project"] = args ? args.project : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["throughputCapacity"] = args ? args.throughputCapacity : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(LiteReservation.__pulumiType, name, resourceInputs, opts);
}
}
exports.LiteReservation = LiteReservation;
/** @internal */
LiteReservation.__pulumiType = 'gcp:pubsub/liteReservation:LiteReservation';
//# sourceMappingURL=liteReservation.js.map