gcp logo
Google Cloud Classic v6.57.0, May 30 23

gcp.compute.Disk

Explore with Pulumi AI

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:

Example Usage

Disk Basic

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var @default = new Gcp.Compute.Disk("default", new()
    {
        Image = "debian-11-bullseye-v20220719",
        Labels = 
        {
            { "environment", "dev" },
        },
        PhysicalBlockSizeBytes = 4096,
        Type = "pd-ssd",
        Zone = "us-central1-a",
    });

});
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/compute"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := compute.NewDisk(ctx, "default", &compute.DiskArgs{
			Image: pulumi.String("debian-11-bullseye-v20220719"),
			Labels: pulumi.StringMap{
				"environment": pulumi.String("dev"),
			},
			PhysicalBlockSizeBytes: pulumi.Int(4096),
			Type:                   pulumi.String("pd-ssd"),
			Zone:                   pulumi.String("us-central1-a"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.Disk;
import com.pulumi.gcp.compute.DiskArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var default_ = new Disk("default", DiskArgs.builder()        
            .image("debian-11-bullseye-v20220719")
            .labels(Map.of("environment", "dev"))
            .physicalBlockSizeBytes(4096)
            .type("pd-ssd")
            .zone("us-central1-a")
            .build());

    }
}
import pulumi
import pulumi_gcp as gcp

default = gcp.compute.Disk("default",
    image="debian-11-bullseye-v20220719",
    labels={
        "environment": "dev",
    },
    physical_block_size_bytes=4096,
    type="pd-ssd",
    zone="us-central1-a")
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const _default = new gcp.compute.Disk("default", {
    image: "debian-11-bullseye-v20220719",
    labels: {
        environment: "dev",
    },
    physicalBlockSizeBytes: 4096,
    type: "pd-ssd",
    zone: "us-central1-a",
});
resources:
  default:
    type: gcp:compute:Disk
    properties:
      image: debian-11-bullseye-v20220719
      labels:
        environment: dev
      physicalBlockSizeBytes: 4096
      type: pd-ssd
      zone: us-central1-a

Disk Async

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var primary = new Gcp.Compute.Disk("primary", new()
    {
        Type = "pd-ssd",
        Zone = "us-central1-a",
        PhysicalBlockSizeBytes = 4096,
    }, new CustomResourceOptions
    {
        Provider = google_beta,
    });

    var secondary = new Gcp.Compute.Disk("secondary", new()
    {
        Type = "pd-ssd",
        Zone = "us-east1-c",
        AsyncPrimaryDisk = new Gcp.Compute.Inputs.DiskAsyncPrimaryDiskArgs
        {
            Disk = primary.Id,
        },
        PhysicalBlockSizeBytes = 4096,
    }, new CustomResourceOptions
    {
        Provider = google_beta,
    });

});
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/compute"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		primary, err := compute.NewDisk(ctx, "primary", &compute.DiskArgs{
			Type:                   pulumi.String("pd-ssd"),
			Zone:                   pulumi.String("us-central1-a"),
			PhysicalBlockSizeBytes: pulumi.Int(4096),
		}, pulumi.Provider(google_beta))
		if err != nil {
			return err
		}
		_, err = compute.NewDisk(ctx, "secondary", &compute.DiskArgs{
			Type: pulumi.String("pd-ssd"),
			Zone: pulumi.String("us-east1-c"),
			AsyncPrimaryDisk: &compute.DiskAsyncPrimaryDiskArgs{
				Disk: primary.ID(),
			},
			PhysicalBlockSizeBytes: pulumi.Int(4096),
		}, pulumi.Provider(google_beta))
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.Disk;
import com.pulumi.gcp.compute.DiskArgs;
import com.pulumi.gcp.compute.inputs.DiskAsyncPrimaryDiskArgs;
import com.pulumi.resources.CustomResourceOptions;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var primary = new Disk("primary", DiskArgs.builder()        
            .type("pd-ssd")
            .zone("us-central1-a")
            .physicalBlockSizeBytes(4096)
            .build(), CustomResourceOptions.builder()
                .provider(google_beta)
                .build());

        var secondary = new Disk("secondary", DiskArgs.builder()        
            .type("pd-ssd")
            .zone("us-east1-c")
            .asyncPrimaryDisk(DiskAsyncPrimaryDiskArgs.builder()
                .disk(primary.id())
                .build())
            .physicalBlockSizeBytes(4096)
            .build(), CustomResourceOptions.builder()
                .provider(google_beta)
                .build());

    }
}
import pulumi
import pulumi_gcp as gcp

primary = gcp.compute.Disk("primary",
    type="pd-ssd",
    zone="us-central1-a",
    physical_block_size_bytes=4096,
    opts=pulumi.ResourceOptions(provider=google_beta))
secondary = gcp.compute.Disk("secondary",
    type="pd-ssd",
    zone="us-east1-c",
    async_primary_disk=gcp.compute.DiskAsyncPrimaryDiskArgs(
        disk=primary.id,
    ),
    physical_block_size_bytes=4096,
    opts=pulumi.ResourceOptions(provider=google_beta))
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const primary = new gcp.compute.Disk("primary", {
    type: "pd-ssd",
    zone: "us-central1-a",
    physicalBlockSizeBytes: 4096,
}, {
    provider: google_beta,
});
const secondary = new gcp.compute.Disk("secondary", {
    type: "pd-ssd",
    zone: "us-east1-c",
    asyncPrimaryDisk: {
        disk: primary.id,
    },
    physicalBlockSizeBytes: 4096,
}, {
    provider: google_beta,
});
resources:
  primary:
    type: gcp:compute:Disk
    properties:
      type: pd-ssd
      zone: us-central1-a
      physicalBlockSizeBytes: 4096
    options:
      provider: ${["google-beta"]}
  secondary:
    type: gcp:compute:Disk
    properties:
      type: pd-ssd
      zone: us-east1-c
      asyncPrimaryDisk:
        disk: ${primary.id}
      physicalBlockSizeBytes: 4096
    options:
      provider: ${["google-beta"]}

Create Disk Resource

new Disk(name: string, args?: DiskArgs, opts?: CustomResourceOptions);
@overload
def Disk(resource_name: str,
         opts: Optional[ResourceOptions] = None,
         async_primary_disk: Optional[DiskAsyncPrimaryDiskArgs] = None,
         description: Optional[str] = None,
         disk_encryption_key: Optional[DiskDiskEncryptionKeyArgs] = None,
         image: Optional[str] = None,
         interface: Optional[str] = None,
         labels: Optional[Mapping[str, str]] = None,
         multi_writer: Optional[bool] = None,
         name: Optional[str] = None,
         physical_block_size_bytes: Optional[int] = None,
         project: Optional[str] = None,
         provisioned_iops: Optional[int] = None,
         resource_policies: Optional[Sequence[str]] = None,
         size: Optional[int] = None,
         snapshot: Optional[str] = None,
         source_disk: Optional[str] = None,
         source_image_encryption_key: Optional[DiskSourceImageEncryptionKeyArgs] = None,
         source_snapshot_encryption_key: Optional[DiskSourceSnapshotEncryptionKeyArgs] = None,
         type: Optional[str] = None,
         zone: Optional[str] = None)
@overload
def Disk(resource_name: str,
         args: Optional[DiskArgs] = None,
         opts: Optional[ResourceOptions] = None)
func NewDisk(ctx *Context, name string, args *DiskArgs, opts ...ResourceOption) (*Disk, error)
public Disk(string name, DiskArgs? args = null, CustomResourceOptions? opts = null)
public Disk(String name, DiskArgs args)
public Disk(String name, DiskArgs args, CustomResourceOptions options)
type: gcp:compute:Disk
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args DiskArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args DiskArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args DiskArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args DiskArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args DiskArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Disk Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The Disk resource accepts the following input properties:

AsyncPrimaryDisk DiskAsyncPrimaryDiskArgs

A nested object resource

Description string

An optional description of this resource. Provide this property when you create the resource.

DiskEncryptionKey DiskDiskEncryptionKeyArgs

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.

Image string

The image from which to initialize this disk. This can be one of: the image's self_link, 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. For instance, the image centos-6-v20180104 includes its family name centos-6. These images can be referred by family name here.

Interface string

Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI.

Deprecated:

This field is no longer in use, disk interfaces will be automatically determined on attachment. To resolve this issue, remove this field from your config.

Labels Dictionary<string, string>

Labels to apply to this disk. A list of key->value pairs.

MultiWriter bool

Indicates whether or not the disk can be read/write attached to more than one instance.

Name string

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.


PhysicalBlockSizeBytes int

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.

Project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

ProvisionedIops int

Indicates how many IOPS must be provisioned for the disk.

ResourcePolicies List<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.

Size int

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.

Snapshot string

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'
SourceDisk 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}
SourceImageEncryptionKey DiskSourceImageEncryptionKeyArgs

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.

SourceSnapshotEncryptionKey DiskSourceSnapshotEncryptionKeyArgs

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.

Type string

URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk.

Zone string

A reference to the zone where the disk resides.

AsyncPrimaryDisk DiskAsyncPrimaryDiskArgs

A nested object resource

Description string

An optional description of this resource. Provide this property when you create the resource.

DiskEncryptionKey DiskDiskEncryptionKeyArgs

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.

Image string

The image from which to initialize this disk. This can be one of: the image's self_link, 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. For instance, the image centos-6-v20180104 includes its family name centos-6. These images can be referred by family name here.

Interface string

Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI.

Deprecated:

This field is no longer in use, disk interfaces will be automatically determined on attachment. To resolve this issue, remove this field from your config.

Labels map[string]string

Labels to apply to this disk. A list of key->value pairs.

MultiWriter bool

Indicates whether or not the disk can be read/write attached to more than one instance.

Name string

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.


PhysicalBlockSizeBytes int

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.

Project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

ProvisionedIops int

Indicates how many IOPS must be provisioned for the disk.

ResourcePolicies []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.

Size int

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.

Snapshot string

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'
SourceDisk 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}
SourceImageEncryptionKey DiskSourceImageEncryptionKeyArgs

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.

SourceSnapshotEncryptionKey DiskSourceSnapshotEncryptionKeyArgs

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.

Type string

URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk.

Zone string

A reference to the zone where the disk resides.

asyncPrimaryDisk DiskAsyncPrimaryDiskArgs

A nested object resource

description String

An optional description of this resource. Provide this property when you create the resource.

diskEncryptionKey DiskDiskEncryptionKeyArgs

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.

image String

The image from which to initialize this disk. This can be one of: the image's self_link, 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. For instance, the image centos-6-v20180104 includes its family name centos-6. These images can be referred by family name here.

interface_ String

Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI.

Deprecated:

This field is no longer in use, disk interfaces will be automatically determined on attachment. To resolve this issue, remove this field from your config.

labels Map<String,String>

Labels to apply to this disk. A list of key->value pairs.

multiWriter Boolean

Indicates whether or not the disk can be read/write attached to more than one instance.

name String

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.


physicalBlockSizeBytes Integer

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.

project String

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

provisionedIops Integer

Indicates how many IOPS must be provisioned for the disk.

resourcePolicies List<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.

size Integer

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.

snapshot String

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'
sourceDisk 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}
sourceImageEncryptionKey DiskSourceImageEncryptionKeyArgs

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.

sourceSnapshotEncryptionKey DiskSourceSnapshotEncryptionKeyArgs

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.

type String

URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk.

zone String

A reference to the zone where the disk resides.

asyncPrimaryDisk DiskAsyncPrimaryDiskArgs

A nested object resource

description string

An optional description of this resource. Provide this property when you create the resource.

diskEncryptionKey DiskDiskEncryptionKeyArgs

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.

image string

The image from which to initialize this disk. This can be one of: the image's self_link, 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. For instance, the image centos-6-v20180104 includes its family name centos-6. These images can be referred by family name here.

interface string

Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI.

Deprecated:

This field is no longer in use, disk interfaces will be automatically determined on attachment. To resolve this issue, remove this field from your config.

labels {[key: string]: string}

Labels to apply to this disk. A list of key->value pairs.

multiWriter boolean

Indicates whether or not the disk can be read/write attached to more than one instance.

name string

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.


physicalBlockSizeBytes number

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.

project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

provisionedIops number

Indicates how many IOPS must be provisioned for the disk.

resourcePolicies 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.

size number

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.

snapshot string

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'
sourceDisk 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}
sourceImageEncryptionKey DiskSourceImageEncryptionKeyArgs

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.

sourceSnapshotEncryptionKey DiskSourceSnapshotEncryptionKeyArgs

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.

type string

URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk.

zone string

A reference to the zone where the disk resides.

async_primary_disk DiskAsyncPrimaryDiskArgs

A nested object resource

description str

An optional description of this resource. Provide this property when you create the resource.

disk_encryption_key DiskDiskEncryptionKeyArgs

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.

image str

The image from which to initialize this disk. This can be one of: the image's self_link, 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. For instance, the image centos-6-v20180104 includes its family name centos-6. These images can be referred by family name here.

interface str

Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI.

Deprecated:

This field is no longer in use, disk interfaces will be automatically determined on attachment. To resolve this issue, remove this field from your config.

labels Mapping[str, str]

Labels to apply to this disk. A list of key->value pairs.

multi_writer bool

Indicates whether or not the disk can be read/write attached to more than one instance.

name str

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.


physical_block_size_bytes int

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.

project str

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

provisioned_iops int

Indicates how many IOPS must be provisioned for the disk.

resource_policies Sequence[str]

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.

size int

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.

snapshot str

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'
source_disk str

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}
source_image_encryption_key DiskSourceImageEncryptionKeyArgs

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.

source_snapshot_encryption_key DiskSourceSnapshotEncryptionKeyArgs

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.

type str

URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk.

zone str

A reference to the zone where the disk resides.

asyncPrimaryDisk Property Map

A nested object resource

description String

An optional description of this resource. Provide this property when you create the resource.

diskEncryptionKey Property Map

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.

image String

The image from which to initialize this disk. This can be one of: the image's self_link, 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. For instance, the image centos-6-v20180104 includes its family name centos-6. These images can be referred by family name here.

interface String

Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI.

Deprecated:

This field is no longer in use, disk interfaces will be automatically determined on attachment. To resolve this issue, remove this field from your config.

labels Map<String>

Labels to apply to this disk. A list of key->value pairs.

multiWriter Boolean

Indicates whether or not the disk can be read/write attached to more than one instance.

name String

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.


physicalBlockSizeBytes Number

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.

project String

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

provisionedIops Number

Indicates how many IOPS must be provisioned for the disk.

resourcePolicies List<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.

size Number

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.

snapshot String

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'
sourceDisk 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}
sourceImageEncryptionKey Property Map

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.

sourceSnapshotEncryptionKey Property Map

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.

type String

URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk.

zone String

A reference to the zone where the disk resides.

Outputs

All input properties are implicitly available as output properties. Additionally, the Disk resource produces the following output properties:

CreationTimestamp string

Creation timestamp in RFC3339 text format.

Id string

The provider-assigned unique ID for this managed resource.

LabelFingerprint string

The fingerprint used for optimistic locking of this resource. Used internally during updates.

LastAttachTimestamp string

Last attach timestamp in RFC3339 text format.

LastDetachTimestamp string

Last detach timestamp in RFC3339 text format.

SelfLink string

The URI of the created resource.

SourceDiskId 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.

SourceImageId string

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.

SourceSnapshotId string

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.

Users List<string>

Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance

CreationTimestamp string

Creation timestamp in RFC3339 text format.

Id string

The provider-assigned unique ID for this managed resource.

LabelFingerprint string

The fingerprint used for optimistic locking of this resource. Used internally during updates.

LastAttachTimestamp string

Last attach timestamp in RFC3339 text format.

LastDetachTimestamp string

Last detach timestamp in RFC3339 text format.

SelfLink string

The URI of the created resource.

SourceDiskId 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.

SourceImageId string

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.

SourceSnapshotId string

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.

Users []string

Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance

creationTimestamp String

Creation timestamp in RFC3339 text format.

id String

The provider-assigned unique ID for this managed resource.

labelFingerprint String

The fingerprint used for optimistic locking of this resource. Used internally during updates.

lastAttachTimestamp String

Last attach timestamp in RFC3339 text format.

lastDetachTimestamp String

Last detach timestamp in RFC3339 text format.

selfLink String

The URI of the created resource.

sourceDiskId 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.

sourceImageId String

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.

sourceSnapshotId String

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.

users List<String>

Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance

creationTimestamp string

Creation timestamp in RFC3339 text format.

id string

The provider-assigned unique ID for this managed resource.

labelFingerprint string

The fingerprint used for optimistic locking of this resource. Used internally during updates.

lastAttachTimestamp string

Last attach timestamp in RFC3339 text format.

lastDetachTimestamp string

Last detach timestamp in RFC3339 text format.

selfLink string

The URI of the created resource.

sourceDiskId 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.

sourceImageId string

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.

sourceSnapshotId string

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.

users string[]

Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance

creation_timestamp str

Creation timestamp in RFC3339 text format.

id str

The provider-assigned unique ID for this managed resource.

label_fingerprint str

The fingerprint used for optimistic locking of this resource. Used internally during updates.

last_attach_timestamp str

Last attach timestamp in RFC3339 text format.

last_detach_timestamp str

Last detach timestamp in RFC3339 text format.

self_link str

The URI of the created resource.

source_disk_id str

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.

source_image_id str

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.

source_snapshot_id str

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.

users Sequence[str]

Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance

creationTimestamp String

Creation timestamp in RFC3339 text format.

id String

The provider-assigned unique ID for this managed resource.

labelFingerprint String

The fingerprint used for optimistic locking of this resource. Used internally during updates.

lastAttachTimestamp String

Last attach timestamp in RFC3339 text format.

lastDetachTimestamp String

Last detach timestamp in RFC3339 text format.

selfLink String

The URI of the created resource.

sourceDiskId 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.

sourceImageId String

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.

sourceSnapshotId String

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.

users List<String>

Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance

Look up Existing Disk Resource

Get an existing Disk resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: DiskState, opts?: CustomResourceOptions): Disk
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        async_primary_disk: Optional[DiskAsyncPrimaryDiskArgs] = None,
        creation_timestamp: Optional[str] = None,
        description: Optional[str] = None,
        disk_encryption_key: Optional[DiskDiskEncryptionKeyArgs] = None,
        image: Optional[str] = None,
        interface: Optional[str] = None,
        label_fingerprint: Optional[str] = None,
        labels: Optional[Mapping[str, str]] = None,
        last_attach_timestamp: Optional[str] = None,
        last_detach_timestamp: Optional[str] = None,
        multi_writer: Optional[bool] = None,
        name: Optional[str] = None,
        physical_block_size_bytes: Optional[int] = None,
        project: Optional[str] = None,
        provisioned_iops: Optional[int] = None,
        resource_policies: Optional[Sequence[str]] = None,
        self_link: Optional[str] = None,
        size: Optional[int] = None,
        snapshot: Optional[str] = None,
        source_disk: Optional[str] = None,
        source_disk_id: Optional[str] = None,
        source_image_encryption_key: Optional[DiskSourceImageEncryptionKeyArgs] = None,
        source_image_id: Optional[str] = None,
        source_snapshot_encryption_key: Optional[DiskSourceSnapshotEncryptionKeyArgs] = None,
        source_snapshot_id: Optional[str] = None,
        type: Optional[str] = None,
        users: Optional[Sequence[str]] = None,
        zone: Optional[str] = None) -> Disk
func GetDisk(ctx *Context, name string, id IDInput, state *DiskState, opts ...ResourceOption) (*Disk, error)
public static Disk Get(string name, Input<string> id, DiskState? state, CustomResourceOptions? opts = null)
public static Disk get(String name, Output<String> id, DiskState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
AsyncPrimaryDisk DiskAsyncPrimaryDiskArgs

A nested object resource

CreationTimestamp string

Creation timestamp in RFC3339 text format.

Description string

An optional description of this resource. Provide this property when you create the resource.

DiskEncryptionKey DiskDiskEncryptionKeyArgs

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.

Image string

The image from which to initialize this disk. This can be one of: the image's self_link, 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. For instance, the image centos-6-v20180104 includes its family name centos-6. These images can be referred by family name here.

Interface string

Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI.

Deprecated:

This field is no longer in use, disk interfaces will be automatically determined on attachment. To resolve this issue, remove this field from your config.

LabelFingerprint string

The fingerprint used for optimistic locking of this resource. Used internally during updates.

Labels Dictionary<string, string>

Labels to apply to this disk. A list of key->value pairs.

LastAttachTimestamp string

Last attach timestamp in RFC3339 text format.

LastDetachTimestamp string

Last detach timestamp in RFC3339 text format.

MultiWriter bool

Indicates whether or not the disk can be read/write attached to more than one instance.

Name string

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.


PhysicalBlockSizeBytes int

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.

Project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

ProvisionedIops int

Indicates how many IOPS must be provisioned for the disk.

ResourcePolicies List<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.

SelfLink string

The URI of the created resource.

Size int

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.

Snapshot string

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'
SourceDisk 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}
SourceDiskId 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.

SourceImageEncryptionKey DiskSourceImageEncryptionKeyArgs

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.

SourceImageId string

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.

SourceSnapshotEncryptionKey DiskSourceSnapshotEncryptionKeyArgs

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.

SourceSnapshotId string

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.

Type string

URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk.

Users List<string>

Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance

Zone string

A reference to the zone where the disk resides.

AsyncPrimaryDisk DiskAsyncPrimaryDiskArgs

A nested object resource

CreationTimestamp string

Creation timestamp in RFC3339 text format.

Description string

An optional description of this resource. Provide this property when you create the resource.

DiskEncryptionKey DiskDiskEncryptionKeyArgs

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.

Image string

The image from which to initialize this disk. This can be one of: the image's self_link, 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. For instance, the image centos-6-v20180104 includes its family name centos-6. These images can be referred by family name here.

Interface string

Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI.

Deprecated:

This field is no longer in use, disk interfaces will be automatically determined on attachment. To resolve this issue, remove this field from your config.

LabelFingerprint string

The fingerprint used for optimistic locking of this resource. Used internally during updates.

Labels map[string]string

Labels to apply to this disk. A list of key->value pairs.

LastAttachTimestamp string

Last attach timestamp in RFC3339 text format.

LastDetachTimestamp string

Last detach timestamp in RFC3339 text format.

MultiWriter bool

Indicates whether or not the disk can be read/write attached to more than one instance.

Name string

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.


PhysicalBlockSizeBytes int

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.

Project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

ProvisionedIops int

Indicates how many IOPS must be provisioned for the disk.

ResourcePolicies []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.

SelfLink string

The URI of the created resource.

Size int

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.

Snapshot string

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'
SourceDisk 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}
SourceDiskId 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.

SourceImageEncryptionKey DiskSourceImageEncryptionKeyArgs

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.

SourceImageId string

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.

SourceSnapshotEncryptionKey DiskSourceSnapshotEncryptionKeyArgs

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.

SourceSnapshotId string

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.

Type string

URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk.

Users []string

Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance

Zone string

A reference to the zone where the disk resides.

asyncPrimaryDisk DiskAsyncPrimaryDiskArgs

A nested object resource

creationTimestamp String

Creation timestamp in RFC3339 text format.

description String

An optional description of this resource. Provide this property when you create the resource.

diskEncryptionKey DiskDiskEncryptionKeyArgs

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.

image String

The image from which to initialize this disk. This can be one of: the image's self_link, 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. For instance, the image centos-6-v20180104 includes its family name centos-6. These images can be referred by family name here.

interface_ String

Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI.

Deprecated:

This field is no longer in use, disk interfaces will be automatically determined on attachment. To resolve this issue, remove this field from your config.

labelFingerprint String

The fingerprint used for optimistic locking of this resource. Used internally during updates.

labels Map<String,String>

Labels to apply to this disk. A list of key->value pairs.

lastAttachTimestamp String

Last attach timestamp in RFC3339 text format.

lastDetachTimestamp String

Last detach timestamp in RFC3339 text format.

multiWriter Boolean

Indicates whether or not the disk can be read/write attached to more than one instance.

name String

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.


physicalBlockSizeBytes Integer

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.

project String

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

provisionedIops Integer

Indicates how many IOPS must be provisioned for the disk.

resourcePolicies List<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.

selfLink String

The URI of the created resource.

size Integer

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.

snapshot String

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'
sourceDisk 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}
sourceDiskId 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.

sourceImageEncryptionKey DiskSourceImageEncryptionKeyArgs

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.

sourceImageId String

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.

sourceSnapshotEncryptionKey DiskSourceSnapshotEncryptionKeyArgs

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.

sourceSnapshotId String

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.

type String

URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk.

users List<String>

Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance

zone String

A reference to the zone where the disk resides.

asyncPrimaryDisk DiskAsyncPrimaryDiskArgs

A nested object resource

creationTimestamp string

Creation timestamp in RFC3339 text format.

description string

An optional description of this resource. Provide this property when you create the resource.

diskEncryptionKey DiskDiskEncryptionKeyArgs

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.

image string

The image from which to initialize this disk. This can be one of: the image's self_link, 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. For instance, the image centos-6-v20180104 includes its family name centos-6. These images can be referred by family name here.

interface string

Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI.

Deprecated:

This field is no longer in use, disk interfaces will be automatically determined on attachment. To resolve this issue, remove this field from your config.

labelFingerprint string

The fingerprint used for optimistic locking of this resource. Used internally during updates.

labels {[key: string]: string}

Labels to apply to this disk. A list of key->value pairs.

lastAttachTimestamp string

Last attach timestamp in RFC3339 text format.

lastDetachTimestamp string

Last detach timestamp in RFC3339 text format.

multiWriter boolean

Indicates whether or not the disk can be read/write attached to more than one instance.

name string

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.


physicalBlockSizeBytes number

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.

project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

provisionedIops number

Indicates how many IOPS must be provisioned for the disk.

resourcePolicies 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.

selfLink string

The URI of the created resource.

size number

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.

snapshot string

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'
sourceDisk 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}
sourceDiskId 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.

sourceImageEncryptionKey DiskSourceImageEncryptionKeyArgs

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.

sourceImageId string

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.

sourceSnapshotEncryptionKey DiskSourceSnapshotEncryptionKeyArgs

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.

sourceSnapshotId string

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.

type string

URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk.

users string[]

Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance

zone string

A reference to the zone where the disk resides.

async_primary_disk DiskAsyncPrimaryDiskArgs

A nested object resource

creation_timestamp str

Creation timestamp in RFC3339 text format.

description str

An optional description of this resource. Provide this property when you create the resource.

disk_encryption_key DiskDiskEncryptionKeyArgs

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.

image str

The image from which to initialize this disk. This can be one of: the image's self_link, 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. For instance, the image centos-6-v20180104 includes its family name centos-6. These images can be referred by family name here.

interface str

Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI.

Deprecated:

This field is no longer in use, disk interfaces will be automatically determined on attachment. To resolve this issue, remove this field from your config.

label_fingerprint str

The fingerprint used for optimistic locking of this resource. Used internally during updates.

labels Mapping[str, str]

Labels to apply to this disk. A list of key->value pairs.

last_attach_timestamp str

Last attach timestamp in RFC3339 text format.

last_detach_timestamp str

Last detach timestamp in RFC3339 text format.

multi_writer bool

Indicates whether or not the disk can be read/write attached to more than one instance.

name str

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.


physical_block_size_bytes int

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.

project str

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

provisioned_iops int

Indicates how many IOPS must be provisioned for the disk.

resource_policies Sequence[str]

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.

self_link str

The URI of the created resource.

size int

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.

snapshot str

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'
source_disk str

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}
source_disk_id str

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.

source_image_encryption_key DiskSourceImageEncryptionKeyArgs

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.

source_image_id str

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.

source_snapshot_encryption_key DiskSourceSnapshotEncryptionKeyArgs

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.

source_snapshot_id str

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.

type str

URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk.

users Sequence[str]

Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance

zone str

A reference to the zone where the disk resides.

asyncPrimaryDisk Property Map

A nested object resource

creationTimestamp String

Creation timestamp in RFC3339 text format.

description String

An optional description of this resource. Provide this property when you create the resource.

diskEncryptionKey Property Map

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.

image String

The image from which to initialize this disk. This can be one of: the image's self_link, 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. For instance, the image centos-6-v20180104 includes its family name centos-6. These images can be referred by family name here.

interface String

Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI.

Deprecated:

This field is no longer in use, disk interfaces will be automatically determined on attachment. To resolve this issue, remove this field from your config.

labelFingerprint String

The fingerprint used for optimistic locking of this resource. Used internally during updates.

labels Map<String>

Labels to apply to this disk. A list of key->value pairs.

lastAttachTimestamp String

Last attach timestamp in RFC3339 text format.

lastDetachTimestamp String

Last detach timestamp in RFC3339 text format.

multiWriter Boolean

Indicates whether or not the disk can be read/write attached to more than one instance.

name String

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.


physicalBlockSizeBytes Number

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.

project String

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

provisionedIops Number

Indicates how many IOPS must be provisioned for the disk.

resourcePolicies List<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.

selfLink String

The URI of the created resource.

size Number

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.

snapshot String

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'
sourceDisk 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}
sourceDiskId 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.

sourceImageEncryptionKey Property Map

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.

sourceImageId String

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.

sourceSnapshotEncryptionKey Property Map

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.

sourceSnapshotId String

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.

type String

URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk.

users List<String>

Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance

zone String

A reference to the zone where the disk resides.

Supporting Types

DiskAsyncPrimaryDisk

Disk string

Primary disk for asynchronous disk replication.

Disk string

Primary disk for asynchronous disk replication.

disk String

Primary disk for asynchronous disk replication.

disk string

Primary disk for asynchronous disk replication.

disk str

Primary disk for asynchronous disk replication.

disk String

Primary disk for asynchronous disk replication.

DiskDiskEncryptionKey

KmsKeySelfLink string

The self link of the encryption key used to encrypt the disk. Also called KmsKeyName in the cloud console. Your project's Compute Engine System service account (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys

KmsKeyServiceAccount string

The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used.

RawKey string

Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. Note: This property is sensitive and will not be displayed in the plan.

RsaEncryptedKey string

Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. Note: This property is sensitive and will not be displayed in the plan.

Sha256 string

(Output) The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

KmsKeySelfLink string

The self link of the encryption key used to encrypt the disk. Also called KmsKeyName in the cloud console. Your project's Compute Engine System service account (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys

KmsKeyServiceAccount string

The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used.

RawKey string

Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. Note: This property is sensitive and will not be displayed in the plan.

RsaEncryptedKey string

Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. Note: This property is sensitive and will not be displayed in the plan.

Sha256 string

(Output) The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

kmsKeySelfLink String

The self link of the encryption key used to encrypt the disk. Also called KmsKeyName in the cloud console. Your project's Compute Engine System service account (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys

kmsKeyServiceAccount String

The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used.

rawKey String

Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. Note: This property is sensitive and will not be displayed in the plan.

rsaEncryptedKey String

Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. Note: This property is sensitive and will not be displayed in the plan.

sha256 String

(Output) The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

kmsKeySelfLink string

The self link of the encryption key used to encrypt the disk. Also called KmsKeyName in the cloud console. Your project's Compute Engine System service account (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys

kmsKeyServiceAccount string

The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used.

rawKey string

Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. Note: This property is sensitive and will not be displayed in the plan.

rsaEncryptedKey string

Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. Note: This property is sensitive and will not be displayed in the plan.

sha256 string

(Output) The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

kms_key_self_link str

The self link of the encryption key used to encrypt the disk. Also called KmsKeyName in the cloud console. Your project's Compute Engine System service account (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys

kms_key_service_account str

The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used.

raw_key str

Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. Note: This property is sensitive and will not be displayed in the plan.

rsa_encrypted_key str

Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. Note: This property is sensitive and will not be displayed in the plan.

sha256 str

(Output) The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

kmsKeySelfLink String

The self link of the encryption key used to encrypt the disk. Also called KmsKeyName in the cloud console. Your project's Compute Engine System service account (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys

kmsKeyServiceAccount String

The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used.

rawKey String

Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. Note: This property is sensitive and will not be displayed in the plan.

rsaEncryptedKey String

Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. Note: This property is sensitive and will not be displayed in the plan.

sha256 String

(Output) The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

DiskSourceImageEncryptionKey

KmsKeySelfLink string

The self link of the encryption key used to encrypt the disk. Also called KmsKeyName in the cloud console. Your project's Compute Engine System service account (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys

KmsKeyServiceAccount string

The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used.

RawKey string

Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.

Sha256 string

(Output) The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

KmsKeySelfLink string

The self link of the encryption key used to encrypt the disk. Also called KmsKeyName in the cloud console. Your project's Compute Engine System service account (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys

KmsKeyServiceAccount string

The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used.

RawKey string

Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.

Sha256 string

(Output) The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

kmsKeySelfLink String

The self link of the encryption key used to encrypt the disk. Also called KmsKeyName in the cloud console. Your project's Compute Engine System service account (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys

kmsKeyServiceAccount String

The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used.

rawKey String

Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.

sha256 String

(Output) The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

kmsKeySelfLink string

The self link of the encryption key used to encrypt the disk. Also called KmsKeyName in the cloud console. Your project's Compute Engine System service account (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys

kmsKeyServiceAccount string

The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used.

rawKey string

Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.

sha256 string

(Output) The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

kms_key_self_link str

The self link of the encryption key used to encrypt the disk. Also called KmsKeyName in the cloud console. Your project's Compute Engine System service account (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys

kms_key_service_account str

The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used.

raw_key str

Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.

sha256 str

(Output) The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

kmsKeySelfLink String

The self link of the encryption key used to encrypt the disk. Also called KmsKeyName in the cloud console. Your project's Compute Engine System service account (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys

kmsKeyServiceAccount String

The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used.

rawKey String

Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.

sha256 String

(Output) The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

DiskSourceSnapshotEncryptionKey

KmsKeySelfLink string

The self link of the encryption key used to encrypt the disk. Also called KmsKeyName in the cloud console. Your project's Compute Engine System service account (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys

KmsKeyServiceAccount string

The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used.

RawKey string

Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.

Sha256 string

(Output) The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

KmsKeySelfLink string

The self link of the encryption key used to encrypt the disk. Also called KmsKeyName in the cloud console. Your project's Compute Engine System service account (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys

KmsKeyServiceAccount string

The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used.

RawKey string

Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.

Sha256 string

(Output) The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

kmsKeySelfLink String

The self link of the encryption key used to encrypt the disk. Also called KmsKeyName in the cloud console. Your project's Compute Engine System service account (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys

kmsKeyServiceAccount String

The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used.

rawKey String

Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.

sha256 String

(Output) The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

kmsKeySelfLink string

The self link of the encryption key used to encrypt the disk. Also called KmsKeyName in the cloud console. Your project's Compute Engine System service account (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys

kmsKeyServiceAccount string

The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used.

rawKey string

Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.

sha256 string

(Output) The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

kms_key_self_link str

The self link of the encryption key used to encrypt the disk. Also called KmsKeyName in the cloud console. Your project's Compute Engine System service account (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys

kms_key_service_account str

The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used.

raw_key str

Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.

sha256 str

(Output) The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

kmsKeySelfLink String

The self link of the encryption key used to encrypt the disk. Also called KmsKeyName in the cloud console. Your project's Compute Engine System service account (service-{{PROJECT_NUMBER}}@compute-system.iam.gserviceaccount.com) must have roles/cloudkms.cryptoKeyEncrypterDecrypter to use this feature. See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys

kmsKeyServiceAccount String

The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used.

rawKey String

Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.

sha256 String

(Output) The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

Import

Disk can be imported using any of these accepted formats

 $ pulumi import gcp:compute/disk:Disk default projects/{{project}}/zones/{{zone}}/disks/{{name}}
 $ pulumi import gcp:compute/disk:Disk default {{project}}/{{zone}}/{{name}}
 $ pulumi import gcp:compute/disk:Disk default {{zone}}/{{name}}
 $ pulumi import gcp:compute/disk:Disk default {{name}}

Package Details

Repository
Google Cloud (GCP) Classic pulumi/pulumi-gcp
License
Apache-2.0
Notes

This Pulumi package is based on the google-beta Terraform Provider.