@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
172 lines • 8.06 kB
JavaScript
;
// *** 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.StoragePool = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* A Hyperdisk Storage Pool is a pre-purchased collection of capacity, throughput, and IOPS
* which you can then provision to your applications as needed.
* You can use Hyperdisk Storage Pools to create and manage disks in pools and use the disks across multiple workloads.
*
* To get more information about StoragePool, see:
*
* * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/storagePools)
* * How-to Guides
* * [Create Hyperdisk Storage Pools](https://cloud.google.com/compute/docs/disks/create-storage-pools)
*
* ## Example Usage
*
* ### Compute Storage Pool Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const test_storage_pool_basic = new gcp.compute.StoragePool("test-storage-pool-basic", {
* name: "storage-pool-basic",
* poolProvisionedCapacityGb: "10240",
* poolProvisionedThroughput: "100",
* storagePoolType: "hyperdisk-throughput",
* zone: "us-central1-a",
* deletionProtection: false,
* });
* const project = gcp.organizations.getProject({});
* ```
* ### Compute Storage Pool Full
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const balanced = gcp.compute.getStoragePoolTypes({
* zone: "us-central1-a",
* storagePoolType: "hyperdisk-balanced",
* });
* const test_storage_pool_full = new gcp.compute.StoragePool("test-storage-pool-full", {
* name: "storage-pool-full",
* description: "Hyperdisk Balanced storage pool",
* capacityProvisioningType: "STANDARD",
* poolProvisionedCapacityGb: "10240",
* performanceProvisioningType: "STANDARD",
* poolProvisionedIops: "10000",
* poolProvisionedThroughput: "1024",
* storagePoolType: balanced.then(balanced => balanced.selfLink),
* deletionProtection: false,
* zone: "us-central1-a",
* });
* const project = gcp.organizations.getProject({});
* ```
*
* ## Import
*
* StoragePool can be imported using any of these accepted formats:
*
* * `projects/{{project}}/zones/{{zone}}/storagePools/{{name}}`
*
* * `{{project}}/{{zone}}/{{name}}`
*
* * `{{zone}}/{{name}}`
*
* * `{{name}}`
*
* When using the `pulumi import` command, StoragePool can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:compute/storagePool:StoragePool default projects/{{project}}/zones/{{zone}}/storagePools/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:compute/storagePool:StoragePool default {{project}}/{{zone}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:compute/storagePool:StoragePool default {{zone}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:compute/storagePool:StoragePool default {{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["capacityProvisioningType"] = state ? state.capacityProvisioningType : undefined;
resourceInputs["creationTimestamp"] = state ? state.creationTimestamp : undefined;
resourceInputs["deletionProtection"] = state ? state.deletionProtection : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["kind"] = state ? state.kind : undefined;
resourceInputs["labelFingerprint"] = state ? state.labelFingerprint : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["performanceProvisioningType"] = state ? state.performanceProvisioningType : undefined;
resourceInputs["poolProvisionedCapacityGb"] = state ? state.poolProvisionedCapacityGb : undefined;
resourceInputs["poolProvisionedIops"] = state ? state.poolProvisionedIops : undefined;
resourceInputs["poolProvisionedThroughput"] = state ? state.poolProvisionedThroughput : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["resourceStatuses"] = state ? state.resourceStatuses : undefined;
resourceInputs["statuses"] = state ? state.statuses : undefined;
resourceInputs["storagePoolType"] = state ? state.storagePoolType : undefined;
resourceInputs["zone"] = state ? state.zone : undefined;
}
else {
const args = argsOrState;
if ((!args || args.poolProvisionedCapacityGb === undefined) && !opts.urn) {
throw new Error("Missing required property 'poolProvisionedCapacityGb'");
}
if ((!args || args.poolProvisionedThroughput === undefined) && !opts.urn) {
throw new Error("Missing required property 'poolProvisionedThroughput'");
}
if ((!args || args.storagePoolType === undefined) && !opts.urn) {
throw new Error("Missing required property 'storagePoolType'");
}
resourceInputs["capacityProvisioningType"] = args ? args.capacityProvisioningType : undefined;
resourceInputs["deletionProtection"] = args ? args.deletionProtection : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["performanceProvisioningType"] = args ? args.performanceProvisioningType : undefined;
resourceInputs["poolProvisionedCapacityGb"] = args ? args.poolProvisionedCapacityGb : undefined;
resourceInputs["poolProvisionedIops"] = args ? args.poolProvisionedIops : undefined;
resourceInputs["poolProvisionedThroughput"] = args ? args.poolProvisionedThroughput : undefined;
resourceInputs["project"] = args ? args.project : undefined;
resourceInputs["storagePoolType"] = args ? args.storagePoolType : undefined;
resourceInputs["zone"] = args ? args.zone : undefined;
resourceInputs["creationTimestamp"] = undefined /*out*/;
resourceInputs["kind"] = undefined /*out*/;
resourceInputs["labelFingerprint"] = undefined /*out*/;
resourceInputs["resourceStatuses"] = undefined /*out*/;
resourceInputs["statuses"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(StoragePool.__pulumiType, name, resourceInputs, opts);
}
}
exports.StoragePool = StoragePool;
/** @internal */
StoragePool.__pulumiType = 'gcp:compute/storagePool:StoragePool';
//# sourceMappingURL=storagePool.js.map