UNPKG

@pulumi/gcp

Version:

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

985 lines (984 loc) • 46.1 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * 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}} * ``` */ export declare 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: string, id: pulumi.Input<pulumi.ID>, state?: DiskState, opts?: pulumi.CustomResourceOptions): Disk; /** * 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: any): obj is Disk; /** * The access mode of the disk. * For example: * * READ_WRITE_SINGLE: The default AccessMode, means the disk can be attached to single instance in RW mode. * * READ_WRITE_MANY: The AccessMode means the disk can be attached to multiple instances in RW mode. * * READ_ONLY_SINGLE: The AccessMode means the disk can be attached to multiple instances in RO mode. * The AccessMode is only valid for Hyperdisk disk types. */ readonly accessMode: pulumi.Output<string>; /** * The architecture of the disk. Values include `X86_64`, `ARM64`. */ readonly architecture: pulumi.Output<string | undefined>; /** * A nested object resource. * Structure is documented below. */ readonly asyncPrimaryDisk: pulumi.Output<outputs.compute.DiskAsyncPrimaryDisk | undefined>; /** * If set to true, a snapshot of the disk will be created before it is destroyed. * If your disk is encrypted with customer managed encryption keys these will be reused for the snapshot creation. * The name of the snapshot by default will be `{{disk-name}}-YYYYMMDD-HHmm` */ readonly createSnapshotBeforeDestroy: pulumi.Output<boolean | undefined>; /** * This will set a custom name prefix for the snapshot that's created when the disk is deleted. */ readonly createSnapshotBeforeDestroyPrefix: pulumi.Output<string | undefined>; /** * Creation timestamp in RFC3339 text format. */ readonly creationTimestamp: pulumi.Output<string>; /** * An optional description of this resource. Provide this property when * you create the resource. */ readonly description: pulumi.Output<string | undefined>; /** * Encrypts the disk using a customer-supplied encryption key. * After you encrypt a disk with a customer-supplied key, you must * provide the same key if you use the disk later (e.g. to create a disk * snapshot or an image, or to attach the disk to a virtual machine). * Customer-supplied encryption keys do not protect access to metadata of * the disk. * If you do not provide an encryption key when creating the disk, then * the disk will be encrypted using an automatically generated key and * you do not need to provide a key to use the disk later. * Structure is documented below. */ readonly diskEncryptionKey: pulumi.Output<outputs.compute.DiskDiskEncryptionKey | undefined>; /** * The unique identifier for the resource. This identifier is defined by the server. */ readonly diskId: pulumi.Output<string>; /** * All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services. */ readonly effectiveLabels: pulumi.Output<{ [key: string]: string; }>; /** * Whether this disk is using confidential compute mode. * Note: Only supported on hyperdisk skus, diskEncryptionKey is required when setting to true */ readonly enableConfidentialCompute: pulumi.Output<boolean>; /** * A list of features to enable on the guest operating system. * Applicable only for bootable disks. * Structure is documented below. */ readonly guestOsFeatures: pulumi.Output<outputs.compute.DiskGuestOsFeature[]>; /** * The image from which to initialize this disk. This can be * one of: the image's `selfLink`, `projects/{project}/global/images/{image}`, * `projects/{project}/global/images/family/{family}`, `global/images/{image}`, * `global/images/family/{family}`, `family/{family}`, `{project}/{family}`, * `{project}/{image}`, `{family}`, or `{image}`. If referred by family, the * images names must include the family name. If they don't, use the * [gcp.compute.Image data source](https://www.terraform.io/docs/providers/google/d/compute_image.html). * For instance, the image `centos-6-v20180104` includes its family name `centos-6`. * These images can be referred by family name here. */ readonly image: pulumi.Output<string | undefined>; /** * Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI. * * > **Warning:** `interface` is deprecated and will be removed in a future major release. This field is no longer used and can be safely removed from your configurations; disk interfaces are automatically determined on attachment. * * @deprecated `interface` is deprecated and will be removed in a future major release. This field is no longer used and can be safely removed from your configurations; disk interfaces are automatically determined on attachment. */ readonly interface: pulumi.Output<string | undefined>; /** * The fingerprint used for optimistic locking of this resource. Used * internally during updates. */ readonly labelFingerprint: pulumi.Output<string>; /** * Labels to apply to this disk. A list of key->value pairs. * * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. * Please refer to the field `effectiveLabels` for all of the labels present on the resource. */ readonly labels: pulumi.Output<{ [key: string]: string; } | undefined>; /** * Last attach timestamp in RFC3339 text format. */ readonly lastAttachTimestamp: pulumi.Output<string>; /** * Last detach timestamp in RFC3339 text format. */ readonly lastDetachTimestamp: pulumi.Output<string>; /** * Any applicable license URI. */ readonly licenses: pulumi.Output<string[]>; /** * Indicates whether or not the disk can be read/write attached to more than one instance. */ readonly multiWriter: pulumi.Output<boolean | undefined>; /** * Name of the resource. Provided by the client when the resource is * created. The name must be 1-63 characters long, and comply with * RFC1035. Specifically, the name must be 1-63 characters long and match * the regular expression `a-z?` which means the * first character must be a lowercase letter, and all following * characters must be a dash, lowercase letter, or digit, except the last * character, which cannot be a dash. */ readonly name: pulumi.Output<string>; /** * Additional params passed with the request, but not persisted as part of resource payload * Structure is documented below. */ readonly params: pulumi.Output<outputs.compute.DiskParams | undefined>; /** * Physical block size of the persistent disk, in bytes. If not present * in a request, a default value is used. Currently supported sizes * are 4096 and 16384, other sizes may be added in the future. * If an unsupported value is requested, the error message will list * the supported values for the caller's project. */ readonly physicalBlockSizeBytes: pulumi.Output<number>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ readonly project: pulumi.Output<string>; /** * Indicates how many IOPS must be provisioned for the disk. * Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk * allows for an update of IOPS every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it */ readonly provisionedIops: pulumi.Output<number>; /** * Indicates how much Throughput must be provisioned for the disk. * Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk * allows for an update of Throughput every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it */ readonly provisionedThroughput: pulumi.Output<number>; /** * The combination of labels configured directly on the resource * and default labels configured on the provider. */ readonly pulumiLabels: pulumi.Output<{ [key: string]: string; }>; /** * Resource policies applied to this disk for automatic snapshot creations. * ~>**NOTE** This value does not support updating the * resource policy, as resource policies can not be updated more than * one at a time. Use * `gcp.compute.DiskResourcePolicyAttachment` * to allow for updating the resource policy attached to the disk. */ readonly resourcePolicies: pulumi.Output<string[]>; /** * The URI of the created resource. */ readonly selfLink: pulumi.Output<string>; /** * Size of the persistent disk, specified in GB. You can specify this * field when creating a persistent disk using the `image` or * `snapshot` parameter, or specify it alone to create an empty * persistent disk. * If you specify this field along with `image` or `snapshot`, * the value must not be less than the size of the image * or the size of the snapshot. * ~>**NOTE** If you change the size, the provider updates the disk size * if upsizing is detected but recreates the disk if downsizing is requested. * You can add `lifecycle.prevent_destroy` in the config to prevent destroying * and recreating. */ readonly size: pulumi.Output<number>; /** * The source snapshot used to create this disk. You can provide this as * a partial or full URL to the resource. If the snapshot is in another * project than this disk, you must supply a full URL. For example, the * following are valid values: * * `https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot` * * `projects/project/global/snapshots/snapshot` * * `global/snapshots/snapshot` */ readonly snapshot: pulumi.Output<string | undefined>; /** * The source disk used to create this disk. You can provide this as a partial or full URL to the resource. * For example, the following are valid values: * * https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/disks/{disk} * * https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/disks/{disk} * * projects/{project}/zones/{zone}/disks/{disk} * * projects/{project}/regions/{region}/disks/{disk} * * zones/{zone}/disks/{disk} * * regions/{region}/disks/{disk} */ readonly sourceDisk: pulumi.Output<string | undefined>; /** * The ID value of the disk used to create this image. This value may * be used to determine whether the image was taken from the current * or a previous instance of a given disk name. */ readonly sourceDiskId: pulumi.Output<string>; /** * The customer-supplied encryption key of the source image. Required if * the source image is protected by a customer-supplied encryption key. * Structure is documented below. */ readonly sourceImageEncryptionKey: pulumi.Output<outputs.compute.DiskSourceImageEncryptionKey | undefined>; /** * The ID value of the image used to create this disk. This value * identifies the exact image that was used to create this persistent * disk. For example, if you created the persistent disk from an image * that was later deleted and recreated under the same name, the source * image ID would identify the exact version of the image that was used. */ readonly sourceImageId: pulumi.Output<string>; /** * The source instant snapshot used to create this disk. You can provide this as a partial or full URL to the resource. * For example, the following are valid values: * * `https://www.googleapis.com/compute/v1/projects/project/zones/zone/instantSnapshots/instantSnapshot` * * `projects/project/zones/zone/instantSnapshots/instantSnapshot` * * `zones/zone/instantSnapshots/instantSnapshot` */ readonly sourceInstantSnapshot: pulumi.Output<string | undefined>; /** * The unique ID of the instant snapshot used to create this disk. This value identifies * the exact instant snapshot that was used to create this persistent disk. * For example, if you created the persistent disk from an instant snapshot that was later * deleted and recreated under the same name, the source instant snapshot ID would identify * the exact version of the instant snapshot that was used. */ readonly sourceInstantSnapshotId: pulumi.Output<string>; /** * The customer-supplied encryption key of the source snapshot. Required * if the source snapshot is protected by a customer-supplied encryption * key. * Structure is documented below. */ readonly sourceSnapshotEncryptionKey: pulumi.Output<outputs.compute.DiskSourceSnapshotEncryptionKey | undefined>; /** * The unique ID of the snapshot used to create this disk. This value * identifies the exact snapshot that was used to create this persistent * disk. For example, if you created the persistent disk from a snapshot * that was later deleted and recreated under the same name, the source * snapshot ID would identify the exact version of the snapshot that was * used. */ readonly sourceSnapshotId: pulumi.Output<string>; /** * The full Google Cloud Storage URI where the disk image is stored. * This file must be a gzip-compressed tarball whose name ends in .tar.gz or virtual machine disk whose name ends in vmdk. * Valid URIs may start with gs:// or https://storage.googleapis.com/. * This flag is not optimized for creating multiple disks from a source storage object. * To create many disks from a source storage object, use gcloud compute images import instead. */ readonly sourceStorageObject: pulumi.Output<string | undefined>; /** * The URL or the name of the storage pool in which the new disk is created. * For example: * * https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/storagePools/{storagePool} * * /projects/{project}/zones/{zone}/storagePools/{storagePool} * * /zones/{zone}/storagePools/{storagePool} * * /{storagePool} */ readonly storagePool: pulumi.Output<string | undefined>; /** * URL of the disk type resource describing which disk type to use to * create the disk. Provide this when creating the disk. */ readonly type: pulumi.Output<string | undefined>; /** * Links to the users of the disk (attached instances) in form: * project/zones/zone/instances/instance */ readonly users: pulumi.Output<string[]>; /** * A reference to the zone where the disk resides. */ readonly zone: pulumi.Output<string>; /** * Create a Disk resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args?: DiskArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Disk resources. */ export interface DiskState { /** * The access mode of the disk. * For example: * * READ_WRITE_SINGLE: The default AccessMode, means the disk can be attached to single instance in RW mode. * * READ_WRITE_MANY: The AccessMode means the disk can be attached to multiple instances in RW mode. * * READ_ONLY_SINGLE: The AccessMode means the disk can be attached to multiple instances in RO mode. * The AccessMode is only valid for Hyperdisk disk types. */ accessMode?: pulumi.Input<string>; /** * The architecture of the disk. Values include `X86_64`, `ARM64`. */ architecture?: pulumi.Input<string>; /** * A nested object resource. * Structure is documented below. */ asyncPrimaryDisk?: pulumi.Input<inputs.compute.DiskAsyncPrimaryDisk>; /** * If set to true, a snapshot of the disk will be created before it is destroyed. * If your disk is encrypted with customer managed encryption keys these will be reused for the snapshot creation. * The name of the snapshot by default will be `{{disk-name}}-YYYYMMDD-HHmm` */ createSnapshotBeforeDestroy?: pulumi.Input<boolean>; /** * This will set a custom name prefix for the snapshot that's created when the disk is deleted. */ createSnapshotBeforeDestroyPrefix?: pulumi.Input<string>; /** * Creation timestamp in RFC3339 text format. */ creationTimestamp?: pulumi.Input<string>; /** * An optional description of this resource. Provide this property when * you create the resource. */ description?: pulumi.Input<string>; /** * Encrypts the disk using a customer-supplied encryption key. * After you encrypt a disk with a customer-supplied key, you must * provide the same key if you use the disk later (e.g. to create a disk * snapshot or an image, or to attach the disk to a virtual machine). * Customer-supplied encryption keys do not protect access to metadata of * the disk. * If you do not provide an encryption key when creating the disk, then * the disk will be encrypted using an automatically generated key and * you do not need to provide a key to use the disk later. * Structure is documented below. */ diskEncryptionKey?: pulumi.Input<inputs.compute.DiskDiskEncryptionKey>; /** * The unique identifier for the resource. This identifier is defined by the server. */ diskId?: pulumi.Input<string>; /** * All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services. */ effectiveLabels?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * Whether this disk is using confidential compute mode. * Note: Only supported on hyperdisk skus, diskEncryptionKey is required when setting to true */ enableConfidentialCompute?: pulumi.Input<boolean>; /** * A list of features to enable on the guest operating system. * Applicable only for bootable disks. * Structure is documented below. */ guestOsFeatures?: pulumi.Input<pulumi.Input<inputs.compute.DiskGuestOsFeature>[]>; /** * The image from which to initialize this disk. This can be * one of: the image's `selfLink`, `projects/{project}/global/images/{image}`, * `projects/{project}/global/images/family/{family}`, `global/images/{image}`, * `global/images/family/{family}`, `family/{family}`, `{project}/{family}`, * `{project}/{image}`, `{family}`, or `{image}`. If referred by family, the * images names must include the family name. If they don't, use the * [gcp.compute.Image data source](https://www.terraform.io/docs/providers/google/d/compute_image.html). * For instance, the image `centos-6-v20180104` includes its family name `centos-6`. * These images can be referred by family name here. */ image?: pulumi.Input<string>; /** * Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI. * * > **Warning:** `interface` is deprecated and will be removed in a future major release. This field is no longer used and can be safely removed from your configurations; disk interfaces are automatically determined on attachment. * * @deprecated `interface` is deprecated and will be removed in a future major release. This field is no longer used and can be safely removed from your configurations; disk interfaces are automatically determined on attachment. */ interface?: pulumi.Input<string>; /** * The fingerprint used for optimistic locking of this resource. Used * internally during updates. */ labelFingerprint?: pulumi.Input<string>; /** * Labels to apply to this disk. A list of key->value pairs. * * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. * Please refer to the field `effectiveLabels` for all of the labels present on the resource. */ labels?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * Last attach timestamp in RFC3339 text format. */ lastAttachTimestamp?: pulumi.Input<string>; /** * Last detach timestamp in RFC3339 text format. */ lastDetachTimestamp?: pulumi.Input<string>; /** * Any applicable license URI. */ licenses?: pulumi.Input<pulumi.Input<string>[]>; /** * Indicates whether or not the disk can be read/write attached to more than one instance. */ multiWriter?: pulumi.Input<boolean>; /** * Name of the resource. Provided by the client when the resource is * created. The name must be 1-63 characters long, and comply with * RFC1035. Specifically, the name must be 1-63 characters long and match * the regular expression `a-z?` which means the * first character must be a lowercase letter, and all following * characters must be a dash, lowercase letter, or digit, except the last * character, which cannot be a dash. */ name?: pulumi.Input<string>; /** * Additional params passed with the request, but not persisted as part of resource payload * Structure is documented below. */ params?: pulumi.Input<inputs.compute.DiskParams>; /** * Physical block size of the persistent disk, in bytes. If not present * in a request, a default value is used. Currently supported sizes * are 4096 and 16384, other sizes may be added in the future. * If an unsupported value is requested, the error message will list * the supported values for the caller's project. */ physicalBlockSizeBytes?: pulumi.Input<number>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string>; /** * Indicates how many IOPS must be provisioned for the disk. * Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk * allows for an update of IOPS every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it */ provisionedIops?: pulumi.Input<number>; /** * Indicates how much Throughput must be provisioned for the disk. * Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk * allows for an update of Throughput every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it */ provisionedThroughput?: pulumi.Input<number>; /** * The combination of labels configured directly on the resource * and default labels configured on the provider. */ pulumiLabels?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * Resource policies applied to this disk for automatic snapshot creations. * ~>**NOTE** This value does not support updating the * resource policy, as resource policies can not be updated more than * one at a time. Use * `gcp.compute.DiskResourcePolicyAttachment` * to allow for updating the resource policy attached to the disk. */ resourcePolicies?: pulumi.Input<pulumi.Input<string>[]>; /** * The URI of the created resource. */ selfLink?: pulumi.Input<string>; /** * Size of the persistent disk, specified in GB. You can specify this * field when creating a persistent disk using the `image` or * `snapshot` parameter, or specify it alone to create an empty * persistent disk. * If you specify this field along with `image` or `snapshot`, * the value must not be less than the size of the image * or the size of the snapshot. * ~>**NOTE** If you change the size, the provider updates the disk size * if upsizing is detected but recreates the disk if downsizing is requested. * You can add `lifecycle.prevent_destroy` in the config to prevent destroying * and recreating. */ size?: pulumi.Input<number>; /** * The source snapshot used to create this disk. You can provide this as * a partial or full URL to the resource. If the snapshot is in another * project than this disk, you must supply a full URL. For example, the * following are valid values: * * `https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot` * * `projects/project/global/snapshots/snapshot` * * `global/snapshots/snapshot` */ snapshot?: pulumi.Input<string>; /** * The source disk used to create this disk. You can provide this as a partial or full URL to the resource. * For example, the following are valid values: * * https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/disks/{disk} * * https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/disks/{disk} * * projects/{project}/zones/{zone}/disks/{disk} * * projects/{project}/regions/{region}/disks/{disk} * * zones/{zone}/disks/{disk} * * regions/{region}/disks/{disk} */ sourceDisk?: pulumi.Input<string>; /** * The ID value of the disk used to create this image. This value may * be used to determine whether the image was taken from the current * or a previous instance of a given disk name. */ sourceDiskId?: pulumi.Input<string>; /** * The customer-supplied encryption key of the source image. Required if * the source image is protected by a customer-supplied encryption key. * Structure is documented below. */ sourceImageEncryptionKey?: pulumi.Input<inputs.compute.DiskSourceImageEncryptionKey>; /** * The ID value of the image used to create this disk. This value * identifies the exact image that was used to create this persistent * disk. For example, if you created the persistent disk from an image * that was later deleted and recreated under the same name, the source * image ID would identify the exact version of the image that was used. */ sourceImageId?: pulumi.Input<string>; /** * The source instant snapshot used to create this disk. You can provide this as a partial or full URL to the resource. * For example, the following are valid values: * * `https://www.googleapis.com/compute/v1/projects/project/zones/zone/instantSnapshots/instantSnapshot` * * `projects/project/zones/zone/instantSnapshots/instantSnapshot` * * `zones/zone/instantSnapshots/instantSnapshot` */ sourceInstantSnapshot?: pulumi.Input<string>; /** * The unique ID of the instant snapshot used to create this disk. This value identifies * the exact instant snapshot that was used to create this persistent disk. * For example, if you created the persistent disk from an instant snapshot that was later * deleted and recreated under the same name, the source instant snapshot ID would identify * the exact version of the instant snapshot that was used. */ sourceInstantSnapshotId?: pulumi.Input<string>; /** * The customer-supplied encryption key of the source snapshot. Required * if the source snapshot is protected by a customer-supplied encryption * key. * Structure is documented below. */ sourceSnapshotEncryptionKey?: pulumi.Input<inputs.compute.DiskSourceSnapshotEncryptionKey>; /** * The unique ID of the snapshot used to create this disk. This value * identifies the exact snapshot that was used to create this persistent * disk. For example, if you created the persistent disk from a snapshot * that was later deleted and recreated under the same name, the source * snapshot ID would identify the exact version of the snapshot that was * used. */ sourceSnapshotId?: pulumi.Input<string>; /** * The full Google Cloud Storage URI where the disk image is stored. * This file must be a gzip-compressed tarball whose name ends in .tar.gz or virtual machine disk whose name ends in vmdk. * Valid URIs may start with gs:// or https://storage.googleapis.com/. * This flag is not optimized for creating multiple disks from a source storage object. * To create many disks from a source storage object, use gcloud compute images import instead. */ sourceStorageObject?: pulumi.Input<string>; /** * The URL or the name of the storage pool in which the new disk is created. * For example: * * https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/storagePools/{storagePool} * * /projects/{project}/zones/{zone}/storagePools/{storagePool} * * /zones/{zone}/storagePools/{storagePool} * * /{storagePool} */ storagePool?: pulumi.Input<string>; /** * URL of the disk type resource describing which disk type to use to * create the disk. Provide this when creating the disk. */ type?: pulumi.Input<string>; /** * Links to the users of the disk (attached instances) in form: * project/zones/zone/instances/instance */ users?: pulumi.Input<pulumi.Input<string>[]>; /** * A reference to the zone where the disk resides. */ zone?: pulumi.Input<string>; } /** * The set of arguments for constructing a Disk resource. */ export interface DiskArgs { /** * The access mode of the disk. * For example: * * READ_WRITE_SINGLE: The default AccessMode, means the disk can be attached to single instance in RW mode. * * READ_WRITE_MANY: The AccessMode means the disk can be attached to multiple instances in RW mode. * * READ_ONLY_SINGLE: The AccessMode means the disk can be attached to multiple instances in RO mode. * The AccessMode is only valid for Hyperdisk disk types. */ accessMode?: pulumi.Input<string>; /** * The architecture of the disk. Values include `X86_64`, `ARM64`. */ architecture?: pulumi.Input<string>; /** * A nested object resource. * Structure is documented below. */ asyncPrimaryDisk?: pulumi.Input<inputs.compute.DiskAsyncPrimaryDisk>; /** * If set to true, a snapshot of the disk will be created before it is destroyed. * If your disk is encrypted with customer managed encryption keys these will be reused for the snapshot creation. * The name of the snapshot by default will be `{{disk-name}}-YYYYMMDD-HHmm` */ createSnapshotBeforeDestroy?: pulumi.Input<boolean>; /** * This will set a custom name prefix for the snapshot that's created when the disk is deleted. */ createSnapshotBeforeDestroyPrefix?: pulumi.Input<string>; /** * An optional description of this resource. Provide this property when * you create the resource. */ description?: pulumi.Input<string>; /** * Encrypts the disk using a customer-supplied encryption key. * After you encrypt a disk with a customer-supplied key, you must * provide the same key if you use the disk later (e.g. to create a disk * snapshot or an image, or to attach the disk to a virtual machine). * Customer-supplied encryption keys do not protect access to metadata of * the disk. * If you do not provide an encryption key when creating the disk, then * the disk will be encrypted using an automatically generated key and * you do not need to provide a key to use the disk later. * Structure is documented below. */ diskEncryptionKey?: pulumi.Input<inputs.compute.DiskDiskEncryptionKey>; /** * Whether this disk is using confidential compute mode. * Note: Only supported on hyperdisk skus, diskEncryptionKey is required when setting to true */ enableConfidentialCompute?: pulumi.Input<boolean>; /** * A list of features to enable on the guest operating system. * Applicable only for bootable disks. * Structure is documented below. */ guestOsFeatures?: pulumi.Input<pulumi.Input<inputs.compute.DiskGuestOsFeature>[]>; /** * The image from which to initialize this disk. This can be * one of: the image's `selfLink`, `projects/{project}/global/images/{image}`, * `projects/{project}/global/images/family/{family}`, `global/images/{image}`, * `global/images/family/{family}`, `family/{family}`, `{project}/{family}`, * `{project}/{image}`, `{family}`, or `{image}`. If referred by family, the * images names must include the family name. If they don't, use the * [gcp.compute.Image data source](https://www.terraform.io/docs/providers/google/d/compute_image.html). * For instance, the image `centos-6-v20180104` includes its family name `centos-6`. * These images can be referred by family name here. */ image?: pulumi.Input<string>; /** * Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI. * * > **Warning:** `interface` is deprecated and will be removed in a future major release. This field is no longer used and can be safely removed from your configurations; disk interfaces are automatically determined on attachment. * * @deprecated `interface` is deprecated and will be removed in a future major release. This field is no longer used and can be safely removed from your configurations; disk interfaces are automatically determined on attachment. */ interface?: pulumi.Input<string>; /** * Labels to apply to this disk. A list of key->value pairs. * * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. * Please refer to the field `effectiveLabels` for all of the labels present on the resource. */ labels?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * Any applicable license URI. */ licenses?: pulumi.Input<pulumi.Input<string>[]>; /** * Indicates whether or not the disk can be read/write attached to more than one instance. */ multiWriter?: pulumi.Input<boolean>; /** * Name of the resource. Provided by the client when the resource is * created. The name must be 1-63 characters long, and comply with * RFC1035. Specifically, the name must be 1-63 characters long and match * the regular expression `a-z?` which means the * first character must be a lowercase letter, and all following * characters must be a dash, lowercase letter, or digit, except the last * character, which cannot be a dash. */ name?: pulumi.Input<string>; /** * Additional params passed with the request, but not persisted as part of resource payload * Structure is documented below. */ params?: pulumi.Input<inputs.compute.DiskParams>; /** * Physical block size of the persistent disk, in bytes. If not present * in a request, a default value is used. Currently supported sizes * are 4096 and 16384, other sizes may be added in the future. * If an unsupported value is requested, the error message will list * the supported values for the caller's project. */ physicalBlockSizeBytes?: pulumi.Input<number>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string>; /** * Indicates how many IOPS must be provisioned for the disk. * Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk * allows for an update of IOPS every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it */ provisionedIops?: pulumi.Input<number>; /** * Indicates how much Throughput must be provisioned for the disk. * Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk * allows for an update of Throughput every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it */ provisionedThroughput?: pulumi.Input<number>; /** * Resource policies applied to this disk for automatic snapshot creations. * ~>**NOTE** This value does not support updating the * resource policy, as resource policies can not be updated more than * one at a time. Use * `gcp.compute.DiskResourcePolicyAttachment` * to allow for updating the resource policy attached to the disk. */ resourcePolicies?: pulumi.Input<pulumi.Input<string>[]>; /** * Size of the persistent disk, specified in GB. You can specify this * field when creating a persistent disk using the `image` or * `snapshot` parameter, or specify it alone to create an empty * persistent disk. * If you specify this field along with `image` or `snapshot`, * the value must not be less than the size of the image * or the size of the snapshot. * ~>**NOTE** If you change the size, the provider updates the disk size * if upsizing is detected but recreates the disk if downsizing is requested. * You can add `lifecycle.prevent_destroy` in the config to prevent destroying * and recreating. */ size?: pulumi.Input<number>; /** * The source snapshot used to create this disk. You can provide this as * a partial or full URL to the resource. If the snapshot is in another * project than this disk, you must supply a full URL. For example, the * following are valid values: * * `https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot` * * `projects/project/global/snapshots/snapshot` * * `global/snapshots/snapshot` */ snapshot?: pulumi.Input<string>; /** * The source disk used to create this disk. You can provide this as a partial or full URL to the resource. * For example, the following are valid values: * * https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/disks/{disk} * * https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/disks/{disk} * * projects/{project}/zones/{zone}/disks/{disk} * * projects/{project}/regions/{region}/disks/{disk} * * zones/{zone}/disks/{disk} * * regions/{region}/disks/{disk} */ sourceDisk?: pulumi.Input<string>; /** * The customer-supplied encryption key of the source image. Required if * the source image is protected by a customer-supplied encryption key. * Structure is documented below. */ sourceImageEncryptionKey?: pulumi.Input<inputs.compute.DiskSourceImageEncryptionKey>; /** * The source instant snapshot used to create this disk. You can provide this as a partial or full URL to the resource. * For example, the following are valid values: * * `https://www.googleapis.com/compute/v1/projects/project/zones/zone/instantSnapshots/instantSnapshot` * * `projects/project/zones/zone/instantSnapshots/instantSnapshot` * * `zones/zone/instantSnapshots/instantSnapshot` */ sourceInstantSnapshot?: pulumi.Input<string>; /** * The customer-supplied encryption key of the source snapshot. Required * if the source snapshot is protected by a customer-supplied encryption * key. * Structure is documented below. */ sourceSnapshotEncryptionKey?: pulumi.Input<inputs.compute.DiskSourceSnapshotEncryptionKey>; /** * The full Google Cloud Storage URI where the disk image is stored. * This file must be a gzip-compressed tarball whose name ends in .tar.gz or virtual machine disk whose name ends in vmdk. * Valid URIs may start with gs:// or https://storage.googleapis.com/. * This flag is not optimized for creating multiple disks from a source storage object. * To create many disks from a source storage object, use gcloud compute images import instead. */ sourceStorageObject?: pulumi.Input<string>; /** * The URL or the name of the storage pool in which the new disk is created. * For example: * * https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/storagePools/{storagePool} * * /projects/{project}/zones/{zone}/storagePools/{storagePool} * * /zones/{zone}/storagePools/{storagePool} * * /{storagePool} */ storagePool?: pulumi.Input<string>; /** * URL of the disk type resource describing which disk type to use to * create the disk. Provide this when creating the disk. */ type?: pulumi.Input<string>; /** * A reference to the zone where the disk resides. */ zone?: pulumi.Input<string>; }