UNPKG

@pulumi/gcp

Version:

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

260 lines • 11.6 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! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.Disk = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Persistent disks are durable storage devices that function similarly to * the physical disks in a desktop or a server. Compute Engine manages the * hardware behind these devices to ensure data redundancy and optimize * performance for you. Persistent disks are available as either standard * hard disk drives (HDD) or solid-state drives (SSD). * * Persistent disks are located independently from your virtual machine * instances, so you can detach or move persistent disks to keep your data * even after you delete your instances. Persistent disk performance scales * automatically with size, so you can resize your existing persistent disks * or add more persistent disks to an instance to meet your performance and * storage space requirements. * * Add a persistent disk to your instance when you need reliable and * affordable storage with consistent performance characteristics. * * To get more information about Disk, see: * * * [API documentation](https://cloud.google.com/compute/docs/reference/v1/disks) * * How-to Guides * * [Adding a persistent disk](https://cloud.google.com/compute/docs/disks/add-persistent-disk) * * ## Example Usage * * ### Disk Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const _default = new gcp.compute.Disk("default", { * name: "test-disk", * type: "pd-ssd", * zone: "us-central1-a", * image: "debian-11-bullseye-v20220719", * labels: { * environment: "dev", * }, * physicalBlockSizeBytes: 4096, * }); * ``` * ### Disk Async * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const primary = new gcp.compute.Disk("primary", { * name: "async-test-disk", * type: "pd-ssd", * zone: "us-central1-a", * physicalBlockSizeBytes: 4096, * }); * const secondary = new gcp.compute.Disk("secondary", { * name: "async-secondary-test-disk", * type: "pd-ssd", * zone: "us-east1-c", * asyncPrimaryDisk: { * disk: primary.id, * }, * physicalBlockSizeBytes: 4096, * }); * ``` * ### Disk Features * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const _default = new gcp.compute.Disk("default", { * name: "test-disk-features", * type: "pd-ssd", * zone: "us-central1-a", * labels: { * environment: "dev", * }, * guestOsFeatures: [ * { * type: "SECURE_BOOT", * }, * { * type: "MULTI_IP_SUBNET", * }, * { * type: "WINDOWS", * }, * ], * licenses: ["https://www.googleapis.com/compute/v1/projects/windows-cloud/global/licenses/windows-server-core"], * physicalBlockSizeBytes: 4096, * }); * ``` * * ## Import * * Disk can be imported using any of these accepted formats: * * * `projects/{{project}}/zones/{{zone}}/disks/{{name}}` * * * `{{project}}/{{zone}}/{{name}}` * * * `{{zone}}/{{name}}` * * * `{{name}}` * * When using the `pulumi import` command, Disk can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:compute/disk:Disk default projects/{{project}}/zones/{{zone}}/disks/{{name}} * ``` * * ```sh * $ pulumi import gcp:compute/disk:Disk default {{project}}/{{zone}}/{{name}} * ``` * * ```sh * $ pulumi import gcp:compute/disk:Disk default {{zone}}/{{name}} * ``` * * ```sh * $ pulumi import gcp:compute/disk:Disk default {{name}} * ``` */ class Disk extends pulumi.CustomResource { /** * Get an existing Disk 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 Disk(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of Disk. 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'] === Disk.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["accessMode"] = state?.accessMode; resourceInputs["architecture"] = state?.architecture; resourceInputs["asyncPrimaryDisk"] = state?.asyncPrimaryDisk; resourceInputs["createSnapshotBeforeDestroy"] = state?.createSnapshotBeforeDestroy; resourceInputs["createSnapshotBeforeDestroyPrefix"] = state?.createSnapshotBeforeDestroyPrefix; resourceInputs["creationTimestamp"] = state?.creationTimestamp; resourceInputs["description"] = state?.description; resourceInputs["diskEncryptionKey"] = state?.diskEncryptionKey; resourceInputs["diskId"] = state?.diskId; resourceInputs["effectiveLabels"] = state?.effectiveLabels; resourceInputs["enableConfidentialCompute"] = state?.enableConfidentialCompute; resourceInputs["guestOsFeatures"] = state?.guestOsFeatures; resourceInputs["image"] = state?.image; resourceInputs["interface"] = state?.interface; resourceInputs["labelFingerprint"] = state?.labelFingerprint; resourceInputs["labels"] = state?.labels; resourceInputs["lastAttachTimestamp"] = state?.lastAttachTimestamp; resourceInputs["lastDetachTimestamp"] = state?.lastDetachTimestamp; resourceInputs["licenses"] = state?.licenses; resourceInputs["multiWriter"] = state?.multiWriter; resourceInputs["name"] = state?.name; resourceInputs["params"] = state?.params; resourceInputs["physicalBlockSizeBytes"] = state?.physicalBlockSizeBytes; resourceInputs["project"] = state?.project; resourceInputs["provisionedIops"] = state?.provisionedIops; resourceInputs["provisionedThroughput"] = state?.provisionedThroughput; resourceInputs["pulumiLabels"] = state?.pulumiLabels; resourceInputs["resourcePolicies"] = state?.resourcePolicies; resourceInputs["selfLink"] = state?.selfLink; resourceInputs["size"] = state?.size; resourceInputs["snapshot"] = state?.snapshot; resourceInputs["sourceDisk"] = state?.sourceDisk; resourceInputs["sourceDiskId"] = state?.sourceDiskId; resourceInputs["sourceImageEncryptionKey"] = state?.sourceImageEncryptionKey; resourceInputs["sourceImageId"] = state?.sourceImageId; resourceInputs["sourceInstantSnapshot"] = state?.sourceInstantSnapshot; resourceInputs["sourceInstantSnapshotId"] = state?.sourceInstantSnapshotId; resourceInputs["sourceSnapshotEncryptionKey"] = state?.sourceSnapshotEncryptionKey; resourceInputs["sourceSnapshotId"] = state?.sourceSnapshotId; resourceInputs["sourceStorageObject"] = state?.sourceStorageObject; resourceInputs["storagePool"] = state?.storagePool; resourceInputs["type"] = state?.type; resourceInputs["users"] = state?.users; resourceInputs["zone"] = state?.zone; } else { const args = argsOrState; resourceInputs["accessMode"] = args?.accessMode; resourceInputs["architecture"] = args?.architecture; resourceInputs["asyncPrimaryDisk"] = args?.asyncPrimaryDisk; resourceInputs["createSnapshotBeforeDestroy"] = args?.createSnapshotBeforeDestroy; resourceInputs["createSnapshotBeforeDestroyPrefix"] = args?.createSnapshotBeforeDestroyPrefix; resourceInputs["description"] = args?.description; resourceInputs["diskEncryptionKey"] = args?.diskEncryptionKey; resourceInputs["enableConfidentialCompute"] = args?.enableConfidentialCompute; resourceInputs["guestOsFeatures"] = args?.guestOsFeatures; resourceInputs["image"] = args?.image; resourceInputs["interface"] = args?.interface; resourceInputs["labels"] = args?.labels; resourceInputs["licenses"] = args?.licenses; resourceInputs["multiWriter"] = args?.multiWriter; resourceInputs["name"] = args?.name; resourceInputs["params"] = args?.params; resourceInputs["physicalBlockSizeBytes"] = args?.physicalBlockSizeBytes; resourceInputs["project"] = args?.project; resourceInputs["provisionedIops"] = args?.provisionedIops; resourceInputs["provisionedThroughput"] = args?.provisionedThroughput; resourceInputs["resourcePolicies"] = args?.resourcePolicies; resourceInputs["size"] = args?.size; resourceInputs["snapshot"] = args?.snapshot; resourceInputs["sourceDisk"] = args?.sourceDisk; resourceInputs["sourceImageEncryptionKey"] = args?.sourceImageEncryptionKey; resourceInputs["sourceInstantSnapshot"] = args?.sourceInstantSnapshot; resourceInputs["sourceSnapshotEncryptionKey"] = args?.sourceSnapshotEncryptionKey; resourceInputs["sourceStorageObject"] = args?.sourceStorageObject; resourceInputs["storagePool"] = args?.storagePool; resourceInputs["type"] = args?.type; resourceInputs["zone"] = args?.zone; resourceInputs["creationTimestamp"] = undefined /*out*/; resourceInputs["diskId"] = undefined /*out*/; resourceInputs["effectiveLabels"] = undefined /*out*/; resourceInputs["labelFingerprint"] = undefined /*out*/; resourceInputs["lastAttachTimestamp"] = undefined /*out*/; resourceInputs["lastDetachTimestamp"] = undefined /*out*/; resourceInputs["pulumiLabels"] = undefined /*out*/; resourceInputs["selfLink"] = undefined /*out*/; resourceInputs["sourceDiskId"] = undefined /*out*/; resourceInputs["sourceImageId"] = undefined /*out*/; resourceInputs["sourceInstantSnapshotId"] = undefined /*out*/; resourceInputs["sourceSnapshotId"] = undefined /*out*/; resourceInputs["users"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(Disk.__pulumiType, name, resourceInputs, opts); } } exports.Disk = Disk; /** @internal */ Disk.__pulumiType = 'gcp:compute/disk:Disk'; //# sourceMappingURL=disk.js.map