@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
169 lines • 8.19 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.StoragePool = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* ## Example Usage
*
* ### Storage Pool Create
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* // Create a network or use datasource to reference existing network
* const peeringNetwork = new gcp.compute.Network("peering_network", {name: "test-network"});
* // Reserve a CIDR for NetApp Volumes to use
* // When using shared-VPCs, this resource needs to be created in host project
* const privateIpAlloc = new gcp.compute.GlobalAddress("private_ip_alloc", {
* name: "test-address",
* purpose: "VPC_PEERING",
* addressType: "INTERNAL",
* prefixLength: 16,
* network: peeringNetwork.id,
* });
* // Create a Private Service Access connection
* // When using shared-VPCs, this resource needs to be created in host project
* const _default = new gcp.servicenetworking.Connection("default", {
* network: peeringNetwork.id,
* service: "netapp.servicenetworking.goog",
* reservedPeeringRanges: [privateIpAlloc.name],
* });
* // Modify the PSA Connection to allow import/export of custom routes
* // When using shared-VPCs, this resource needs to be created in host project
* const routeUpdates = new gcp.compute.NetworkPeeringRoutesConfig("route_updates", {
* peering: _default.peering,
* network: peeringNetwork.name,
* importCustomRoutes: true,
* exportCustomRoutes: true,
* });
* // Create a storage pool
* // Create this resource in the project which is expected to own the volumes
* const testPool = new gcp.netapp.StoragePool("test_pool", {
* name: "test-pool",
* location: "us-central1",
* serviceLevel: "PREMIUM",
* capacityGib: "2048",
* network: peeringNetwork.id,
* });
* ```
*
* ## Import
*
* StoragePool can be imported using any of these accepted formats:
*
* * `projects/{{project}}/locations/{{location}}/storagePools/{{name}}`
*
* * `{{project}}/{{location}}/{{name}}`
*
* * `{{location}}/{{name}}`
*
* When using the `pulumi import` command, StoragePool can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:netapp/storagePool:StoragePool default projects/{{project}}/locations/{{location}}/storagePools/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:netapp/storagePool:StoragePool default {{project}}/{{location}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:netapp/storagePool:StoragePool default {{location}}/{{name}}
* ```
*/
class StoragePool extends pulumi.CustomResource {
/**
* Get an existing StoragePool 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 StoragePool(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of StoragePool. 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'] === StoragePool.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["activeDirectory"] = state ? state.activeDirectory : undefined;
resourceInputs["allowAutoTiering"] = state ? state.allowAutoTiering : undefined;
resourceInputs["capacityGib"] = state ? state.capacityGib : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["effectiveLabels"] = state ? state.effectiveLabels : undefined;
resourceInputs["encryptionType"] = state ? state.encryptionType : undefined;
resourceInputs["kmsConfig"] = state ? state.kmsConfig : undefined;
resourceInputs["labels"] = state ? state.labels : undefined;
resourceInputs["ldapEnabled"] = state ? state.ldapEnabled : 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["replicaZone"] = state ? state.replicaZone : undefined;
resourceInputs["serviceLevel"] = state ? state.serviceLevel : undefined;
resourceInputs["volumeCapacityGib"] = state ? state.volumeCapacityGib : undefined;
resourceInputs["volumeCount"] = state ? state.volumeCount : undefined;
resourceInputs["zone"] = state ? state.zone : undefined;
}
else {
const args = argsOrState;
if ((!args || args.capacityGib === undefined) && !opts.urn) {
throw new Error("Missing required property 'capacityGib'");
}
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'");
}
if ((!args || args.serviceLevel === undefined) && !opts.urn) {
throw new Error("Missing required property 'serviceLevel'");
}
resourceInputs["activeDirectory"] = args ? args.activeDirectory : undefined;
resourceInputs["allowAutoTiering"] = args ? args.allowAutoTiering : undefined;
resourceInputs["capacityGib"] = args ? args.capacityGib : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["kmsConfig"] = args ? args.kmsConfig : undefined;
resourceInputs["labels"] = args ? args.labels : undefined;
resourceInputs["ldapEnabled"] = args ? args.ldapEnabled : undefined;
resourceInputs["location"] = args ? args.location : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["network"] = args ? args.network : undefined;
resourceInputs["project"] = args ? args.project : undefined;
resourceInputs["replicaZone"] = args ? args.replicaZone : undefined;
resourceInputs["serviceLevel"] = args ? args.serviceLevel : undefined;
resourceInputs["zone"] = args ? args.zone : undefined;
resourceInputs["effectiveLabels"] = undefined /*out*/;
resourceInputs["encryptionType"] = undefined /*out*/;
resourceInputs["pulumiLabels"] = undefined /*out*/;
resourceInputs["volumeCapacityGib"] = undefined /*out*/;
resourceInputs["volumeCount"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(StoragePool.__pulumiType, name, resourceInputs, opts);
}
}
exports.StoragePool = StoragePool;
/** @internal */
StoragePool.__pulumiType = 'gcp:netapp/storagePool:StoragePool';
//# sourceMappingURL=storagePool.js.map