@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
210 lines • 9.01 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 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, 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["accessPoints"] = state ? state.accessPoints : undefined;
resourceInputs["capacityGib"] = state ? state.capacityGib : undefined;
resourceInputs["createTime"] = state ? state.createTime : undefined;
resourceInputs["daosVersion"] = state ? state.daosVersion : undefined;
resourceInputs["deploymentType"] = state ? state.deploymentType : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["directoryStripeLevel"] = state ? state.directoryStripeLevel : undefined;
resourceInputs["effectiveLabels"] = state ? state.effectiveLabels : undefined;
resourceInputs["effectiveReservedIpRange"] = state ? state.effectiveReservedIpRange : undefined;
resourceInputs["fileStripeLevel"] = state ? state.fileStripeLevel : undefined;
resourceInputs["instanceId"] = state ? state.instanceId : undefined;
resourceInputs["labels"] = state ? state.labels : undefined;
resourceInputs["location"] = state ? state.location : 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["reservedIpRange"] = state ? state.reservedIpRange : 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.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'");
}
resourceInputs["capacityGib"] = args ? args.capacityGib : undefined;
resourceInputs["deploymentType"] = args ? args.deploymentType : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["directoryStripeLevel"] = args ? args.directoryStripeLevel : undefined;
resourceInputs["fileStripeLevel"] = args ? args.fileStripeLevel : 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["reservedIpRange"] = args ? args.reservedIpRange : undefined;
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