@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
155 lines • 7.13 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.Instance = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* A Managed Lustre instance
*
* ## Example Usage
*
* ### Lustre Instance Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* // This example assumes this network already exists.
* // The API creates a tenant network per network authorized for a
* // Lustre instance and that network is not deleted when the user-created
* // network (authorized_network) is deleted, so this prevents issues
* // with tenant network quota.
* // If this network hasn't been created and you are using this example in your
* // config, add an additional network resource or change
* // this from "data"to "resource"
* const lustre_network = gcp.compute.getNetwork({
* name: "my-network",
* });
* const instance = new gcp.lustre.Instance("instance", {
* instanceId: "my-instance",
* location: "us-central1-a",
* description: "test lustre instance",
* filesystem: "testfs",
* capacityGib: "18000",
* network: lustre_network.then(lustre_network => lustre_network.id),
* labels: {
* test: "value",
* },
* });
* ```
*
* ## Import
*
* Instance can be imported using any of these accepted formats:
*
* * `projects/{{project}}/locations/{{location}}/instances/{{instance_id}}`
*
* * `{{project}}/{{location}}/{{instance_id}}`
*
* * `{{location}}/{{instance_id}}`
*
* When using the `pulumi import` command, Instance can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:lustre/instance:Instance default projects/{{project}}/locations/{{location}}/instances/{{instance_id}}
* ```
*
* ```sh
* $ pulumi import gcp:lustre/instance:Instance default {{project}}/{{location}}/{{instance_id}}
* ```
*
* ```sh
* $ pulumi import gcp:lustre/instance:Instance default {{location}}/{{instance_id}}
* ```
*/
class Instance extends pulumi.CustomResource {
/**
* Get an existing Instance 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 Instance(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Instance. 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'] === Instance.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["capacityGib"] = state ? state.capacityGib : undefined;
resourceInputs["createTime"] = state ? state.createTime : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["effectiveLabels"] = state ? state.effectiveLabels : undefined;
resourceInputs["filesystem"] = state ? state.filesystem : undefined;
resourceInputs["gkeSupportEnabled"] = state ? state.gkeSupportEnabled : undefined;
resourceInputs["instanceId"] = state ? state.instanceId : undefined;
resourceInputs["labels"] = state ? state.labels : undefined;
resourceInputs["location"] = state ? state.location : undefined;
resourceInputs["mountPoint"] = state ? state.mountPoint : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["network"] = state ? state.network : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["pulumiLabels"] = state ? state.pulumiLabels : undefined;
resourceInputs["state"] = state ? state.state : undefined;
resourceInputs["updateTime"] = state ? state.updateTime : undefined;
}
else {
const args = argsOrState;
if ((!args || args.capacityGib === undefined) && !opts.urn) {
throw new Error("Missing required property 'capacityGib'");
}
if ((!args || args.filesystem === undefined) && !opts.urn) {
throw new Error("Missing required property 'filesystem'");
}
if ((!args || args.instanceId === undefined) && !opts.urn) {
throw new Error("Missing required property 'instanceId'");
}
if ((!args || args.location === undefined) && !opts.urn) {
throw new Error("Missing required property 'location'");
}
if ((!args || args.network === undefined) && !opts.urn) {
throw new Error("Missing required property 'network'");
}
resourceInputs["capacityGib"] = args ? args.capacityGib : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["filesystem"] = args ? args.filesystem : undefined;
resourceInputs["gkeSupportEnabled"] = args ? args.gkeSupportEnabled : undefined;
resourceInputs["instanceId"] = args ? args.instanceId : undefined;
resourceInputs["labels"] = args ? args.labels : undefined;
resourceInputs["location"] = args ? args.location : undefined;
resourceInputs["network"] = args ? args.network : undefined;
resourceInputs["project"] = args ? args.project : undefined;
resourceInputs["createTime"] = undefined /*out*/;
resourceInputs["effectiveLabels"] = undefined /*out*/;
resourceInputs["mountPoint"] = undefined /*out*/;
resourceInputs["name"] = undefined /*out*/;
resourceInputs["pulumiLabels"] = undefined /*out*/;
resourceInputs["state"] = undefined /*out*/;
resourceInputs["updateTime"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(Instance.__pulumiType, name, resourceInputs, opts);
}
}
exports.Instance = Instance;
/** @internal */
Instance.__pulumiType = 'gcp:lustre/instance:Instance';
//# sourceMappingURL=instance.js.map