UNPKG

@pulumi/gcp

Version:

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

210 lines • 8.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! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.Instance = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * A Parallelstore Instance. * * ## Example Usage * * ### Parallelstore Instance Basic Beta * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const network = new gcp.compute.Network("network", { * name: "network", * autoCreateSubnetworks: true, * mtu: 8896, * }); * // Create an IP address * const privateIpAlloc = new gcp.compute.GlobalAddress("private_ip_alloc", { * name: "address", * purpose: "VPC_PEERING", * addressType: "INTERNAL", * prefixLength: 24, * network: network.id, * }); * // Create a private connection * const _default = new gcp.servicenetworking.Connection("default", { * network: network.id, * service: "servicenetworking.googleapis.com", * reservedPeeringRanges: [privateIpAlloc.name], * }); * const instance = new gcp.parallelstore.Instance("instance", { * instanceId: "instance", * location: "us-central1-a", * description: "test instance", * capacityGib: "12000", * network: network.name, * fileStripeLevel: "FILE_STRIPE_LEVEL_MIN", * directoryStripeLevel: "DIRECTORY_STRIPE_LEVEL_MIN", * deploymentType: "SCRATCH", * labels: { * test: "value", * }, * }, { * dependsOn: [_default], * }); * ``` * ### Parallelstore Instance Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const network = new gcp.compute.Network("network", { * name: "network", * autoCreateSubnetworks: true, * mtu: 8896, * }); * // Create an IP address * const privateIpAlloc = new gcp.compute.GlobalAddress("private_ip_alloc", { * name: "address", * purpose: "VPC_PEERING", * addressType: "INTERNAL", * prefixLength: 24, * network: network.id, * }); * // Create a private connection * const _default = new gcp.servicenetworking.Connection("default", { * network: network.id, * service: "servicenetworking.googleapis.com", * reservedPeeringRanges: [privateIpAlloc.name], * }); * const instance = new gcp.parallelstore.Instance("instance", { * instanceId: "instance", * location: "us-central1-a", * description: "test instance", * capacityGib: "12000", * network: network.name, * fileStripeLevel: "FILE_STRIPE_LEVEL_MIN", * directoryStripeLevel: "DIRECTORY_STRIPE_LEVEL_MIN", * deploymentType: "SCRATCH", * labels: { * test: "value", * }, * }, { * dependsOn: [_default], * }); * ``` * * ## 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:parallelstore/instance:Instance default projects/{{project}}/locations/{{location}}/instances/{{instance_id}} * ``` * * ```sh * $ pulumi import gcp:parallelstore/instance:Instance default {{project}}/{{location}}/{{instance_id}} * ``` * * ```sh * $ pulumi import gcp:parallelstore/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 }); } /** * 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["accessPoints"] = state?.accessPoints; resourceInputs["capacityGib"] = state?.capacityGib; resourceInputs["createTime"] = state?.createTime; resourceInputs["daosVersion"] = state?.daosVersion; resourceInputs["deploymentType"] = state?.deploymentType; resourceInputs["description"] = state?.description; resourceInputs["directoryStripeLevel"] = state?.directoryStripeLevel; resourceInputs["effectiveLabels"] = state?.effectiveLabels; resourceInputs["effectiveReservedIpRange"] = state?.effectiveReservedIpRange; resourceInputs["fileStripeLevel"] = state?.fileStripeLevel; resourceInputs["instanceId"] = state?.instanceId; resourceInputs["labels"] = state?.labels; resourceInputs["location"] = state?.location; resourceInputs["name"] = state?.name; resourceInputs["network"] = state?.network; resourceInputs["project"] = state?.project; resourceInputs["pulumiLabels"] = state?.pulumiLabels; resourceInputs["reservedIpRange"] = state?.reservedIpRange; resourceInputs["state"] = state?.state; resourceInputs["updateTime"] = state?.updateTime; } else { const args = argsOrState; if (args?.capacityGib === undefined && !opts.urn) { throw new Error("Missing required property 'capacityGib'"); } 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'"); } resourceInputs["capacityGib"] = args?.capacityGib; resourceInputs["deploymentType"] = args?.deploymentType; resourceInputs["description"] = args?.description; resourceInputs["directoryStripeLevel"] = args?.directoryStripeLevel; resourceInputs["fileStripeLevel"] = args?.fileStripeLevel; resourceInputs["instanceId"] = args?.instanceId; resourceInputs["labels"] = args?.labels; resourceInputs["location"] = args?.location; resourceInputs["network"] = args?.network; resourceInputs["project"] = args?.project; resourceInputs["reservedIpRange"] = args?.reservedIpRange; resourceInputs["accessPoints"] = undefined /*out*/; resourceInputs["createTime"] = undefined /*out*/; resourceInputs["daosVersion"] = undefined /*out*/; resourceInputs["effectiveLabels"] = undefined /*out*/; resourceInputs["effectiveReservedIpRange"] = 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:parallelstore/instance:Instance'; //# sourceMappingURL=instance.js.map