@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
207 lines • 9.61 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! ***
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"));
/**
* 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",
* labels: {
* environment: "test",
* purpose: "storage-pool-testing",
* team: "infrastructure",
* cost_center: "engineering",
* },
* 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),
* labels: {
* environment: "test",
* purpose: "storage-pool-testing",
* team: "infrastructure",
* cost_center: "engineering",
* },
* 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}}
* $ pulumi import gcp:compute/storagePool:StoragePool default {{project}}/{{zone}}/{{name}}
* $ pulumi import gcp:compute/storagePool:StoragePool default {{zone}}/{{name}}
* $ 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, { ...opts, id: id });
}
/** @internal */
static __pulumiType = 'gcp:compute/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["capacityProvisioningType"] = state?.capacityProvisioningType;
resourceInputs["creationTimestamp"] = state?.creationTimestamp;
resourceInputs["deletionPolicy"] = state?.deletionPolicy;
resourceInputs["deletionProtection"] = state?.deletionProtection;
resourceInputs["description"] = state?.description;
resourceInputs["effectiveLabels"] = state?.effectiveLabels;
resourceInputs["kind"] = state?.kind;
resourceInputs["labelFingerprint"] = state?.labelFingerprint;
resourceInputs["labels"] = state?.labels;
resourceInputs["name"] = state?.name;
resourceInputs["params"] = state?.params;
resourceInputs["performanceProvisioningType"] = state?.performanceProvisioningType;
resourceInputs["poolProvisionedCapacityGb"] = state?.poolProvisionedCapacityGb;
resourceInputs["poolProvisionedIops"] = state?.poolProvisionedIops;
resourceInputs["poolProvisionedThroughput"] = state?.poolProvisionedThroughput;
resourceInputs["project"] = state?.project;
resourceInputs["pulumiLabels"] = state?.pulumiLabels;
resourceInputs["resourceStatuses"] = state?.resourceStatuses;
resourceInputs["statuses"] = state?.statuses;
resourceInputs["storagePoolType"] = state?.storagePoolType;
resourceInputs["zone"] = state?.zone;
}
else {
const args = argsOrState;
if (args?.poolProvisionedCapacityGb === undefined && !opts.urn) {
throw new Error("Missing required property 'poolProvisionedCapacityGb'");
}
if (args?.poolProvisionedThroughput === undefined && !opts.urn) {
throw new Error("Missing required property 'poolProvisionedThroughput'");
}
if (args?.storagePoolType === undefined && !opts.urn) {
throw new Error("Missing required property 'storagePoolType'");
}
resourceInputs["capacityProvisioningType"] = args?.capacityProvisioningType;
resourceInputs["deletionPolicy"] = args?.deletionPolicy;
resourceInputs["deletionProtection"] = args?.deletionProtection;
resourceInputs["description"] = args?.description;
resourceInputs["labels"] = args?.labels;
resourceInputs["name"] = args?.name;
resourceInputs["params"] = args?.params;
resourceInputs["performanceProvisioningType"] = args?.performanceProvisioningType;
resourceInputs["poolProvisionedCapacityGb"] = args?.poolProvisionedCapacityGb;
resourceInputs["poolProvisionedIops"] = args?.poolProvisionedIops;
resourceInputs["poolProvisionedThroughput"] = args?.poolProvisionedThroughput;
resourceInputs["project"] = args?.project;
resourceInputs["storagePoolType"] = args?.storagePoolType;
resourceInputs["zone"] = args?.zone;
resourceInputs["creationTimestamp"] = undefined /*out*/;
resourceInputs["effectiveLabels"] = undefined /*out*/;
resourceInputs["kind"] = undefined /*out*/;
resourceInputs["labelFingerprint"] = undefined /*out*/;
resourceInputs["pulumiLabels"] = undefined /*out*/;
resourceInputs["resourceStatuses"] = undefined /*out*/;
resourceInputs["statuses"] = 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