@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
213 lines • 11.5 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.Volume = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* A volume is a file system container in a storage pool that stores application, database, and user data.
*
* You can create a volume's capacity using the available capacity in the storage pool and you can define and resize the capacity without disruption to any processes.
*
* Storage pool settings apply to the volumes contained within them automatically.
*
* To get more information about Volume, see:
*
* * [API documentation](https://cloud.google.com/netapp/volumes/docs/reference/rest/v1/projects.locations.volumes)
* * How-to Guides
* * [Documentation](https://cloud.google.com/netapp/volumes/docs/configure-and-use/volumes/overview)
* * [Quickstart](https://cloud.google.com/netapp/volumes/docs/get-started/quickstarts/create-volume)
*
* ## Example Usage
*
* ### Netapp Volume Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const _default = gcp.compute.getNetwork({
* name: "test-network",
* });
* const defaultStoragePool = new gcp.netapp.StoragePool("default", {
* name: "test-pool",
* location: "us-west2",
* serviceLevel: "PREMIUM",
* capacityGib: "2048",
* network: _default.then(_default => _default.id),
* });
* const testVolume = new gcp.netapp.Volume("test_volume", {
* location: "us-west2",
* name: "test-volume",
* capacityGib: "100",
* shareName: "test-volume",
* storagePool: defaultStoragePool.name,
* protocols: ["NFSV3"],
* deletionPolicy: "DEFAULT",
* });
* ```
*
* ## Import
*
* Volume can be imported using any of these accepted formats:
*
* * `projects/{{project}}/locations/{{location}}/volumes/{{name}}`
*
* * `{{project}}/{{location}}/{{name}}`
*
* * `{{location}}/{{name}}`
*
* When using the `pulumi import` command, Volume can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:netapp/volume:Volume default projects/{{project}}/locations/{{location}}/volumes/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:netapp/volume:Volume default {{project}}/{{location}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:netapp/volume:Volume default {{location}}/{{name}}
* ```
*/
class Volume extends pulumi.CustomResource {
/**
* Get an existing Volume 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 Volume(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Volume. 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'] === Volume.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["activeDirectory"] = state ? state.activeDirectory : undefined;
resourceInputs["backupConfig"] = state ? state.backupConfig : undefined;
resourceInputs["capacityGib"] = state ? state.capacityGib : undefined;
resourceInputs["coldTierSizeGib"] = state ? state.coldTierSizeGib : undefined;
resourceInputs["createTime"] = state ? state.createTime : undefined;
resourceInputs["deletionPolicy"] = state ? state.deletionPolicy : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["effectiveLabels"] = state ? state.effectiveLabels : undefined;
resourceInputs["encryptionType"] = state ? state.encryptionType : undefined;
resourceInputs["exportPolicy"] = state ? state.exportPolicy : undefined;
resourceInputs["hasReplication"] = state ? state.hasReplication : undefined;
resourceInputs["kerberosEnabled"] = state ? state.kerberosEnabled : undefined;
resourceInputs["kmsConfig"] = state ? state.kmsConfig : undefined;
resourceInputs["labels"] = state ? state.labels : undefined;
resourceInputs["largeCapacity"] = state ? state.largeCapacity : undefined;
resourceInputs["ldapEnabled"] = state ? state.ldapEnabled : undefined;
resourceInputs["location"] = state ? state.location : undefined;
resourceInputs["mountOptions"] = state ? state.mountOptions : undefined;
resourceInputs["multipleEndpoints"] = state ? state.multipleEndpoints : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["network"] = state ? state.network : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["protocols"] = state ? state.protocols : undefined;
resourceInputs["psaRange"] = state ? state.psaRange : undefined;
resourceInputs["pulumiLabels"] = state ? state.pulumiLabels : undefined;
resourceInputs["replicaZone"] = state ? state.replicaZone : undefined;
resourceInputs["restoreParameters"] = state ? state.restoreParameters : undefined;
resourceInputs["restrictedActions"] = state ? state.restrictedActions : undefined;
resourceInputs["securityStyle"] = state ? state.securityStyle : undefined;
resourceInputs["serviceLevel"] = state ? state.serviceLevel : undefined;
resourceInputs["shareName"] = state ? state.shareName : undefined;
resourceInputs["smbSettings"] = state ? state.smbSettings : undefined;
resourceInputs["snapshotDirectory"] = state ? state.snapshotDirectory : undefined;
resourceInputs["snapshotPolicy"] = state ? state.snapshotPolicy : undefined;
resourceInputs["state"] = state ? state.state : undefined;
resourceInputs["stateDetails"] = state ? state.stateDetails : undefined;
resourceInputs["storagePool"] = state ? state.storagePool : undefined;
resourceInputs["tieringPolicy"] = state ? state.tieringPolicy : undefined;
resourceInputs["unixPermissions"] = state ? state.unixPermissions : undefined;
resourceInputs["usedGib"] = state ? state.usedGib : 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.protocols === undefined) && !opts.urn) {
throw new Error("Missing required property 'protocols'");
}
if ((!args || args.shareName === undefined) && !opts.urn) {
throw new Error("Missing required property 'shareName'");
}
if ((!args || args.storagePool === undefined) && !opts.urn) {
throw new Error("Missing required property 'storagePool'");
}
resourceInputs["backupConfig"] = args ? args.backupConfig : undefined;
resourceInputs["capacityGib"] = args ? args.capacityGib : undefined;
resourceInputs["deletionPolicy"] = args ? args.deletionPolicy : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["exportPolicy"] = args ? args.exportPolicy : undefined;
resourceInputs["kerberosEnabled"] = args ? args.kerberosEnabled : undefined;
resourceInputs["labels"] = args ? args.labels : undefined;
resourceInputs["largeCapacity"] = args ? args.largeCapacity : undefined;
resourceInputs["location"] = args ? args.location : undefined;
resourceInputs["multipleEndpoints"] = args ? args.multipleEndpoints : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["project"] = args ? args.project : undefined;
resourceInputs["protocols"] = args ? args.protocols : undefined;
resourceInputs["restoreParameters"] = args ? args.restoreParameters : undefined;
resourceInputs["restrictedActions"] = args ? args.restrictedActions : undefined;
resourceInputs["securityStyle"] = args ? args.securityStyle : undefined;
resourceInputs["shareName"] = args ? args.shareName : undefined;
resourceInputs["smbSettings"] = args ? args.smbSettings : undefined;
resourceInputs["snapshotDirectory"] = args ? args.snapshotDirectory : undefined;
resourceInputs["snapshotPolicy"] = args ? args.snapshotPolicy : undefined;
resourceInputs["storagePool"] = args ? args.storagePool : undefined;
resourceInputs["tieringPolicy"] = args ? args.tieringPolicy : undefined;
resourceInputs["unixPermissions"] = args ? args.unixPermissions : undefined;
resourceInputs["activeDirectory"] = undefined /*out*/;
resourceInputs["coldTierSizeGib"] = undefined /*out*/;
resourceInputs["createTime"] = undefined /*out*/;
resourceInputs["effectiveLabels"] = undefined /*out*/;
resourceInputs["encryptionType"] = undefined /*out*/;
resourceInputs["hasReplication"] = undefined /*out*/;
resourceInputs["kmsConfig"] = undefined /*out*/;
resourceInputs["ldapEnabled"] = undefined /*out*/;
resourceInputs["mountOptions"] = undefined /*out*/;
resourceInputs["network"] = undefined /*out*/;
resourceInputs["psaRange"] = undefined /*out*/;
resourceInputs["pulumiLabels"] = undefined /*out*/;
resourceInputs["replicaZone"] = undefined /*out*/;
resourceInputs["serviceLevel"] = undefined /*out*/;
resourceInputs["state"] = undefined /*out*/;
resourceInputs["stateDetails"] = undefined /*out*/;
resourceInputs["usedGib"] = undefined /*out*/;
resourceInputs["zone"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(Volume.__pulumiType, name, resourceInputs, opts);
}
}
exports.Volume = Volume;
/** @internal */
Volume.__pulumiType = 'gcp:netapp/volume:Volume';
//# sourceMappingURL=volume.js.map