UNPKG

@pulumi/gcp

Version:

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

264 lines • 10.6 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 Google Cloud Filestore instance. * * To get more information about Instance, see: * * * [API documentation](https://cloud.google.com/filestore/docs/reference/rest/v1beta1/projects.locations.instances/create) * * How-to Guides * * [Copying Data In/Out](https://cloud.google.com/filestore/docs/copying-data) * * [Official Documentation](https://cloud.google.com/filestore/docs/creating-instances) * * [Use with Kubernetes](https://cloud.google.com/filestore/docs/accessing-fileshares) * * ## Example Usage * * ### Filestore Instance Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const instance = new gcp.filestore.Instance("instance", { * name: "test-instance", * location: "us-central1-b", * tier: "BASIC_HDD", * fileShares: { * capacityGb: 1024, * name: "share1", * }, * networks: [{ * network: "default", * modes: ["MODE_IPV4"], * }], * }); * ``` * ### Filestore Instance Full * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const instance = new gcp.filestore.Instance("instance", { * name: "test-instance", * location: "us-central1-b", * tier: "BASIC_SSD", * fileShares: { * capacityGb: 2560, * name: "share1", * nfsExportOptions: [ * { * ipRanges: ["10.0.0.0/24"], * accessMode: "READ_WRITE", * squashMode: "NO_ROOT_SQUASH", * }, * { * ipRanges: ["10.10.0.0/24"], * accessMode: "READ_ONLY", * squashMode: "ROOT_SQUASH", * anonUid: 123, * anonGid: 456, * }, * ], * }, * networks: [{ * network: "default", * modes: ["MODE_IPV4"], * connectMode: "DIRECT_PEERING", * }], * }); * ``` * ### Filestore Instance Protocol * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const instance = new gcp.filestore.Instance("instance", { * name: "test-instance", * location: "us-central1", * tier: "ENTERPRISE", * protocol: "NFS_V4_1", * fileShares: { * capacityGb: 1024, * name: "share1", * }, * networks: [{ * network: "default", * modes: ["MODE_IPV4"], * }], * }); * ``` * ### Filestore Instance Enterprise * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const filestoreKeyring = new gcp.kms.KeyRing("filestore_keyring", { * name: "filestore-keyring", * location: "us-central1", * }); * const filestoreKey = new gcp.kms.CryptoKey("filestore_key", { * name: "filestore-key", * keyRing: filestoreKeyring.id, * }); * const instance = new gcp.filestore.Instance("instance", { * name: "test-instance", * location: "us-central1", * tier: "ENTERPRISE", * fileShares: { * capacityGb: 1024, * name: "share1", * }, * networks: [{ * network: "default", * modes: ["MODE_IPV4"], * }], * kmsKeyName: filestoreKey.id, * }); * ``` * * ## Import * * Instance can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/instances/{{name}}` * * `{{project}}/{{location}}/{{name}}` * * `{{location}}/{{name}}` * * When using the `pulumi import` command, Instance can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:filestore/instance:Instance default projects/{{project}}/locations/{{location}}/instances/{{name}} * $ pulumi import gcp:filestore/instance:Instance default {{project}}/{{location}}/{{name}} * $ pulumi import gcp:filestore/instance:Instance default {{location}}/{{name}} * ``` */ 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:filestore/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["createTime"] = state?.createTime; resourceInputs["deletionPolicy"] = state?.deletionPolicy; resourceInputs["deletionProtectionEnabled"] = state?.deletionProtectionEnabled; resourceInputs["deletionProtectionReason"] = state?.deletionProtectionReason; resourceInputs["description"] = state?.description; resourceInputs["desiredReplicaState"] = state?.desiredReplicaState; resourceInputs["directoryServices"] = state?.directoryServices; resourceInputs["effectiveLabels"] = state?.effectiveLabels; resourceInputs["effectiveReplications"] = state?.effectiveReplications; resourceInputs["etag"] = state?.etag; resourceInputs["fileShares"] = state?.fileShares; resourceInputs["initialReplication"] = state?.initialReplication; resourceInputs["kmsKeyName"] = state?.kmsKeyName; resourceInputs["labels"] = state?.labels; resourceInputs["location"] = state?.location; resourceInputs["name"] = state?.name; resourceInputs["networks"] = state?.networks; resourceInputs["performanceConfig"] = state?.performanceConfig; resourceInputs["project"] = state?.project; resourceInputs["protocol"] = state?.protocol; resourceInputs["pulumiLabels"] = state?.pulumiLabels; resourceInputs["tags"] = state?.tags; resourceInputs["tier"] = state?.tier; resourceInputs["zone"] = state?.zone; } else { const args = argsOrState; if (args?.fileShares === undefined && !opts.urn) { throw new Error("Missing required property 'fileShares'"); } if (args?.networks === undefined && !opts.urn) { throw new Error("Missing required property 'networks'"); } if (args?.tier === undefined && !opts.urn) { throw new Error("Missing required property 'tier'"); } resourceInputs["deletionPolicy"] = args?.deletionPolicy; resourceInputs["deletionProtectionEnabled"] = args?.deletionProtectionEnabled; resourceInputs["deletionProtectionReason"] = args?.deletionProtectionReason; resourceInputs["description"] = args?.description; resourceInputs["desiredReplicaState"] = args?.desiredReplicaState; resourceInputs["directoryServices"] = args?.directoryServices; resourceInputs["fileShares"] = args?.fileShares; resourceInputs["initialReplication"] = args?.initialReplication; resourceInputs["kmsKeyName"] = args?.kmsKeyName; resourceInputs["labels"] = args?.labels; resourceInputs["location"] = args?.location; resourceInputs["name"] = args?.name; resourceInputs["networks"] = args?.networks; resourceInputs["performanceConfig"] = args?.performanceConfig; resourceInputs["project"] = args?.project; resourceInputs["protocol"] = args?.protocol; resourceInputs["tags"] = args?.tags; resourceInputs["tier"] = args?.tier; resourceInputs["zone"] = args?.zone; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["effectiveLabels"] = undefined /*out*/; resourceInputs["effectiveReplications"] = undefined /*out*/; resourceInputs["etag"] = undefined /*out*/; resourceInputs["pulumiLabels"] = 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