UNPKG

@pulumi/gcp

Version:

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

197 lines • 9.35 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.Instance = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * A Managed Lustre instance * * To get more information about Instance, see: * * * [API documentation](https://cloud.google.com/managed-lustre/docs/reference/rest/v1/projects.locations.instances) * * How-to Guides * * [Official Documentation](https://cloud.google.com/managed-lustre/docs/create-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), * perUnitStorageThroughput: "1000", * 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}} * $ pulumi import gcp:lustre/instance:Instance default {{project}}/{{location}}/{{instance_id}} * $ 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, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'gcp:lustre/instance:Instance'; /** * 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["accessRulesOptions"] = state?.accessRulesOptions; resourceInputs["capacityGib"] = state?.capacityGib; resourceInputs["createTime"] = state?.createTime; resourceInputs["deletionPolicy"] = state?.deletionPolicy; resourceInputs["description"] = state?.description; resourceInputs["dynamicTierOptions"] = state?.dynamicTierOptions; resourceInputs["effectiveLabels"] = state?.effectiveLabels; resourceInputs["filesystem"] = state?.filesystem; resourceInputs["gkeSupportEnabled"] = state?.gkeSupportEnabled; resourceInputs["instanceId"] = state?.instanceId; resourceInputs["kmsKey"] = state?.kmsKey; resourceInputs["labels"] = state?.labels; resourceInputs["location"] = state?.location; resourceInputs["maintenancePolicy"] = state?.maintenancePolicy; resourceInputs["mountPoint"] = state?.mountPoint; resourceInputs["name"] = state?.name; resourceInputs["network"] = state?.network; resourceInputs["perUnitStorageThroughput"] = state?.perUnitStorageThroughput; resourceInputs["placementPolicy"] = state?.placementPolicy; resourceInputs["project"] = state?.project; resourceInputs["pulumiLabels"] = state?.pulumiLabels; resourceInputs["state"] = state?.state; resourceInputs["stateReason"] = state?.stateReason; resourceInputs["uid"] = state?.uid; resourceInputs["upcomingMaintenanceSchedules"] = state?.upcomingMaintenanceSchedules; resourceInputs["updateTime"] = state?.updateTime; } else { const args = argsOrState; if (args?.capacityGib === undefined && !opts.urn) { throw new Error("Missing required property 'capacityGib'"); } if (args?.filesystem === undefined && !opts.urn) { throw new Error("Missing required property 'filesystem'"); } if (args?.instanceId === undefined && !opts.urn) { throw new Error("Missing required property 'instanceId'"); } if (args?.location === undefined && !opts.urn) { throw new Error("Missing required property 'location'"); } if (args?.network === undefined && !opts.urn) { throw new Error("Missing required property 'network'"); } resourceInputs["accessRulesOptions"] = args?.accessRulesOptions; resourceInputs["capacityGib"] = args?.capacityGib; resourceInputs["deletionPolicy"] = args?.deletionPolicy; resourceInputs["description"] = args?.description; resourceInputs["dynamicTierOptions"] = args?.dynamicTierOptions; resourceInputs["filesystem"] = args?.filesystem; resourceInputs["gkeSupportEnabled"] = args?.gkeSupportEnabled; resourceInputs["instanceId"] = args?.instanceId; resourceInputs["kmsKey"] = args?.kmsKey; resourceInputs["labels"] = args?.labels; resourceInputs["location"] = args?.location; resourceInputs["maintenancePolicy"] = args?.maintenancePolicy; resourceInputs["network"] = args?.network; resourceInputs["perUnitStorageThroughput"] = args?.perUnitStorageThroughput; resourceInputs["placementPolicy"] = args?.placementPolicy; resourceInputs["project"] = args?.project; 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["stateReason"] = undefined /*out*/; resourceInputs["uid"] = undefined /*out*/; resourceInputs["upcomingMaintenanceSchedules"] = 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; //# sourceMappingURL=instance.js.map