@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
183 lines • 8.77 kB
JavaScript
;
// *** 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.Unit = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
* A Unit is the fundamental structural building block of a SaaS offering. Each Unit is an instance of a UnitKind. It is a versioned, manageable component of a service that has its own lifecycle, representing elements like infrastructure, workloads, or an entire application stack that a service producer intends to manage as a single entity.
*
* ## Example Usage
*
* ### Saas Runtime Unit Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const exampleSaasRegional = new gcp.saasruntime.SaaS("example_saas_regional", {
* saasId: "example-saas",
* location: "us-central1",
* locations: [{
* name: "us-central1",
* }],
* });
* const exampleUnitKind = new gcp.saasruntime.UnitKind("example_unit_kind", {
* location: "us-central1",
* unitKindId: "example-unitkind",
* saas: exampleSaasRegional.id,
* });
* const example = new gcp.saasruntime.Unit("example", {
* location: "us-central1",
* unitId: "example-unit",
* unitKind: exampleUnitKind.id,
* managementMode: "MANAGEMENT_MODE_USER",
* });
* ```
*
* ## Import
*
* Unit can be imported using any of these accepted formats:
*
* * `projects/{{project}}/locations/{{location}}/units/{{unit_id}}`
* * `{{project}}/{{location}}/{{unit_id}}`
* * `{{location}}/{{unit_id}}`
*
* When using the `pulumi import` command, Unit can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:saasruntime/unit:Unit default projects/{{project}}/locations/{{location}}/units/{{unit_id}}
* $ pulumi import gcp:saasruntime/unit:Unit default {{project}}/{{location}}/{{unit_id}}
* $ pulumi import gcp:saasruntime/unit:Unit default {{location}}/{{unit_id}}
* ```
*/
class Unit extends pulumi.CustomResource {
/**
* Get an existing Unit 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 Unit(name, state, { ...opts, id: id });
}
/** @internal */
static __pulumiType = 'gcp:saasruntime/unit:Unit';
/**
* Returns true if the given object is an instance of Unit. 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'] === Unit.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["annotations"] = state?.annotations;
resourceInputs["conditions"] = state?.conditions;
resourceInputs["createTime"] = state?.createTime;
resourceInputs["deletionPolicy"] = state?.deletionPolicy;
resourceInputs["dependencies"] = state?.dependencies;
resourceInputs["dependents"] = state?.dependents;
resourceInputs["effectiveAnnotations"] = state?.effectiveAnnotations;
resourceInputs["effectiveLabels"] = state?.effectiveLabels;
resourceInputs["inputVariables"] = state?.inputVariables;
resourceInputs["labels"] = state?.labels;
resourceInputs["location"] = state?.location;
resourceInputs["maintenance"] = state?.maintenance;
resourceInputs["managementMode"] = state?.managementMode;
resourceInputs["name"] = state?.name;
resourceInputs["ongoingOperations"] = state?.ongoingOperations;
resourceInputs["outputVariables"] = state?.outputVariables;
resourceInputs["pendingOperations"] = state?.pendingOperations;
resourceInputs["project"] = state?.project;
resourceInputs["pulumiLabels"] = state?.pulumiLabels;
resourceInputs["release"] = state?.release;
resourceInputs["scheduledOperations"] = state?.scheduledOperations;
resourceInputs["state"] = state?.state;
resourceInputs["systemCleanupAt"] = state?.systemCleanupAt;
resourceInputs["systemManagedState"] = state?.systemManagedState;
resourceInputs["tenant"] = state?.tenant;
resourceInputs["uid"] = state?.uid;
resourceInputs["unitId"] = state?.unitId;
resourceInputs["unitKind"] = state?.unitKind;
resourceInputs["updateTime"] = state?.updateTime;
}
else {
const args = argsOrState;
if (args?.location === undefined && !opts.urn) {
throw new Error("Missing required property 'location'");
}
if (args?.unitId === undefined && !opts.urn) {
throw new Error("Missing required property 'unitId'");
}
resourceInputs["annotations"] = args?.annotations;
resourceInputs["deletionPolicy"] = args?.deletionPolicy;
resourceInputs["labels"] = args?.labels;
resourceInputs["location"] = args?.location;
resourceInputs["maintenance"] = args?.maintenance;
resourceInputs["managementMode"] = args?.managementMode;
resourceInputs["project"] = args?.project;
resourceInputs["tenant"] = args?.tenant;
resourceInputs["unitId"] = args?.unitId;
resourceInputs["unitKind"] = args?.unitKind;
resourceInputs["conditions"] = undefined /*out*/;
resourceInputs["createTime"] = undefined /*out*/;
resourceInputs["dependencies"] = undefined /*out*/;
resourceInputs["dependents"] = undefined /*out*/;
resourceInputs["effectiveAnnotations"] = undefined /*out*/;
resourceInputs["effectiveLabels"] = undefined /*out*/;
resourceInputs["inputVariables"] = undefined /*out*/;
resourceInputs["name"] = undefined /*out*/;
resourceInputs["ongoingOperations"] = undefined /*out*/;
resourceInputs["outputVariables"] = undefined /*out*/;
resourceInputs["pendingOperations"] = undefined /*out*/;
resourceInputs["pulumiLabels"] = undefined /*out*/;
resourceInputs["release"] = undefined /*out*/;
resourceInputs["scheduledOperations"] = undefined /*out*/;
resourceInputs["state"] = undefined /*out*/;
resourceInputs["systemCleanupAt"] = undefined /*out*/;
resourceInputs["systemManagedState"] = undefined /*out*/;
resourceInputs["uid"] = undefined /*out*/;
resourceInputs["updateTime"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(Unit.__pulumiType, name, resourceInputs, opts);
}
}
exports.Unit = Unit;
//# sourceMappingURL=unit.js.map