UNPKG

@pulumi/gcp

Version:

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

241 lines • 12.5 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.StoragePool = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * Storage pools act as containers for volumes. All volumes in a storage pool share the following information: * * Location * * Service level * * Virtual Private Cloud (VPC) network * * Active Directory policy * * LDAP use for NFS volumes, if applicable * * Customer-managed encryption key (CMEK) policy * * The capacity of the pool can be split up and assigned to volumes within the pool. Storage pools are a billable * component of NetApp Volumes. Billing is based on the location, service level, and capacity allocated to a pool * independent of consumption at the volume level. * * Storage pools of service level Flex are available as zonal (single zone) or regional (two zones in same region) pools. * Zonal and regional pools are high-available within the zone. On top of that, regional pools have `replicaZone` as * hot standby zone. All volume access is served from the `zone`. If `zone` fails, `replicaZone` * automatically becomes the active zone. This will cause state drift in your configuration. * If a zone switch (manual or automatic) is triggered outside of Terraform, you need to adjust the `zone` * and `replicaZone` values to reflect the current state, or Terraform will initiate a zone switch when running * the next apply. You can trigger a manual * [zone switch](https://cloud.google.com/netapp/volumes/docs/configure-and-use/storage-pools/edit-or-delete-storage-pool#switch_active_and_replica_zones) * via Terraform by swapping the value of the `zone` and `replicaZone` parameters in your HCL code. * * To get more information about StoragePool, see: * * * [API documentation](https://cloud.google.com/netapp/volumes/docs/reference/rest/v1/projects.locations.storagePools) * * How-to Guides * * [Quickstart documentation](https://cloud.google.com/netapp/volumes/docs/get-started/quickstarts/create-storage-pool) * * [Regional Flex zone switch](https://cloud.google.com/netapp/volumes/docs/configure-and-use/storage-pools/edit-or-delete-storage-pool#switch_active_and_replica_zones) * * ## Example Usage * * ### Storage Pool Create Doc * * ```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}} * $ pulumi import gcp:netapp/storagePool:StoragePool default {{project}}/{{location}}/{{name}} * $ 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, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'gcp:netapp/storagePool:StoragePool'; /** * 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?.activeDirectory; resourceInputs["allowAutoTiering"] = state?.allowAutoTiering; resourceInputs["availableThroughputMibps"] = state?.availableThroughputMibps; resourceInputs["capacityGib"] = state?.capacityGib; resourceInputs["coldTierSizeUsedGib"] = state?.coldTierSizeUsedGib; resourceInputs["customPerformanceEnabled"] = state?.customPerformanceEnabled; resourceInputs["deletionPolicy"] = state?.deletionPolicy; resourceInputs["description"] = state?.description; resourceInputs["effectiveLabels"] = state?.effectiveLabels; resourceInputs["enableHotTierAutoResize"] = state?.enableHotTierAutoResize; resourceInputs["encryptionType"] = state?.encryptionType; resourceInputs["hotTierSizeGib"] = state?.hotTierSizeGib; resourceInputs["hotTierSizeUsedGib"] = state?.hotTierSizeUsedGib; resourceInputs["kmsConfig"] = state?.kmsConfig; resourceInputs["labels"] = state?.labels; resourceInputs["ldapEnabled"] = state?.ldapEnabled; resourceInputs["location"] = state?.location; resourceInputs["mode"] = state?.mode; resourceInputs["name"] = state?.name; resourceInputs["network"] = state?.network; resourceInputs["project"] = state?.project; resourceInputs["pulumiLabels"] = state?.pulumiLabels; resourceInputs["qosType"] = state?.qosType; resourceInputs["replicaZone"] = state?.replicaZone; resourceInputs["scaleTier"] = state?.scaleTier; resourceInputs["scaleType"] = state?.scaleType; resourceInputs["serviceLevel"] = state?.serviceLevel; resourceInputs["totalIops"] = state?.totalIops; resourceInputs["totalThroughputMibps"] = state?.totalThroughputMibps; resourceInputs["type"] = state?.type; resourceInputs["volumeCapacityGib"] = state?.volumeCapacityGib; resourceInputs["volumeCount"] = state?.volumeCount; resourceInputs["zone"] = state?.zone; } else { const args = argsOrState; if (args?.capacityGib === undefined && !opts.urn) { throw new Error("Missing required property 'capacityGib'"); } if (args?.location === undefined && !opts.urn) { throw new Error("Missing required property 'location'"); } if (args?.network === undefined && !opts.urn) { throw new Error("Missing required property 'network'"); } if (args?.serviceLevel === undefined && !opts.urn) { throw new Error("Missing required property 'serviceLevel'"); } resourceInputs["activeDirectory"] = args?.activeDirectory; resourceInputs["allowAutoTiering"] = args?.allowAutoTiering; resourceInputs["capacityGib"] = args?.capacityGib; resourceInputs["customPerformanceEnabled"] = args?.customPerformanceEnabled; resourceInputs["deletionPolicy"] = args?.deletionPolicy; resourceInputs["description"] = args?.description; resourceInputs["enableHotTierAutoResize"] = args?.enableHotTierAutoResize; resourceInputs["hotTierSizeGib"] = args?.hotTierSizeGib; resourceInputs["kmsConfig"] = args?.kmsConfig; resourceInputs["labels"] = args?.labels; resourceInputs["ldapEnabled"] = args?.ldapEnabled; resourceInputs["location"] = args?.location; resourceInputs["mode"] = args?.mode; resourceInputs["name"] = args?.name; resourceInputs["network"] = args?.network; resourceInputs["project"] = args?.project; resourceInputs["qosType"] = args?.qosType; resourceInputs["replicaZone"] = args?.replicaZone; resourceInputs["scaleTier"] = args?.scaleTier; resourceInputs["scaleType"] = args?.scaleType; resourceInputs["serviceLevel"] = args?.serviceLevel; resourceInputs["totalIops"] = args?.totalIops; resourceInputs["totalThroughputMibps"] = args?.totalThroughputMibps; resourceInputs["type"] = args?.type; resourceInputs["zone"] = args?.zone; resourceInputs["availableThroughputMibps"] = undefined /*out*/; resourceInputs["coldTierSizeUsedGib"] = undefined /*out*/; resourceInputs["effectiveLabels"] = undefined /*out*/; resourceInputs["encryptionType"] = undefined /*out*/; resourceInputs["hotTierSizeUsedGib"] = 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; //# sourceMappingURL=storagePool.js.map