1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. compute
  5. Disk
Google Cloud Classic v8.3.1 published on Wednesday, Sep 25, 2024 by Pulumi

gcp.compute.Disk

Explore with Pulumi AI

gcp logo
Google Cloud Classic v8.3.1 published on Wednesday, Sep 25, 2024 by Pulumi

    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

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const _default = new gcp.compute.Disk("default", {
        name: "test-disk",
        type: "pd-ssd",
        zone: "us-central1-a",
        image: "debian-11-bullseye-v20220719",
        labels: {
            environment: "dev",
        },
        physicalBlockSizeBytes: 4096,
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    default = gcp.compute.Disk("default",
        name="test-disk",
        type="pd-ssd",
        zone="us-central1-a",
        image="debian-11-bullseye-v20220719",
        labels={
            "environment": "dev",
        },
        physical_block_size_bytes=4096)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v8/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{
    			Name:  pulumi.String("test-disk"),
    			Type:  pulumi.String("pd-ssd"),
    			Zone:  pulumi.String("us-central1-a"),
    			Image: pulumi.String("debian-11-bullseye-v20220719"),
    			Labels: pulumi.StringMap{
    				"environment": pulumi.String("dev"),
    			},
    			PhysicalBlockSizeBytes: pulumi.Int(4096),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    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()
        {
            Name = "test-disk",
            Type = "pd-ssd",
            Zone = "us-central1-a",
            Image = "debian-11-bullseye-v20220719",
            Labels = 
            {
                { "environment", "dev" },
            },
            PhysicalBlockSizeBytes = 4096,
        });
    
    });
    
    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()
                .name("test-disk")
                .type("pd-ssd")
                .zone("us-central1-a")
                .image("debian-11-bullseye-v20220719")
                .labels(Map.of("environment", "dev"))
                .physicalBlockSizeBytes(4096)
                .build());
    
        }
    }
    
    resources:
      default:
        type: gcp:compute:Disk
        properties:
          name: test-disk
          type: pd-ssd
          zone: us-central1-a
          image: debian-11-bullseye-v20220719
          labels:
            environment: dev
          physicalBlockSizeBytes: 4096
    

    Disk Async

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const primary = new gcp.compute.Disk("primary", {
        name: "async-test-disk",
        type: "pd-ssd",
        zone: "us-central1-a",
        physicalBlockSizeBytes: 4096,
    });
    const secondary = new gcp.compute.Disk("secondary", {
        name: "async-secondary-test-disk",
        type: "pd-ssd",
        zone: "us-east1-c",
        asyncPrimaryDisk: {
            disk: primary.id,
        },
        physicalBlockSizeBytes: 4096,
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    primary = gcp.compute.Disk("primary",
        name="async-test-disk",
        type="pd-ssd",
        zone="us-central1-a",
        physical_block_size_bytes=4096)
    secondary = gcp.compute.Disk("secondary",
        name="async-secondary-test-disk",
        type="pd-ssd",
        zone="us-east1-c",
        async_primary_disk={
            "disk": primary.id,
        },
        physical_block_size_bytes=4096)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v8/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{
    			Name:                   pulumi.String("async-test-disk"),
    			Type:                   pulumi.String("pd-ssd"),
    			Zone:                   pulumi.String("us-central1-a"),
    			PhysicalBlockSizeBytes: pulumi.Int(4096),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = compute.NewDisk(ctx, "secondary", &compute.DiskArgs{
    			Name: pulumi.String("async-secondary-test-disk"),
    			Type: pulumi.String("pd-ssd"),
    			Zone: pulumi.String("us-east1-c"),
    			AsyncPrimaryDisk: &compute.DiskAsyncPrimaryDiskArgs{
    				Disk: primary.ID(),
    			},
    			PhysicalBlockSizeBytes: pulumi.Int(4096),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    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()
        {
            Name = "async-test-disk",
            Type = "pd-ssd",
            Zone = "us-central1-a",
            PhysicalBlockSizeBytes = 4096,
        });
    
        var secondary = new Gcp.Compute.Disk("secondary", new()
        {
            Name = "async-secondary-test-disk",
            Type = "pd-ssd",
            Zone = "us-east1-c",
            AsyncPrimaryDisk = new Gcp.Compute.Inputs.DiskAsyncPrimaryDiskArgs
            {
                Disk = primary.Id,
            },
            PhysicalBlockSizeBytes = 4096,
        });
    
    });
    
    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 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()
                .name("async-test-disk")
                .type("pd-ssd")
                .zone("us-central1-a")
                .physicalBlockSizeBytes(4096)
                .build());
    
            var secondary = new Disk("secondary", DiskArgs.builder()
                .name("async-secondary-test-disk")
                .type("pd-ssd")
                .zone("us-east1-c")
                .asyncPrimaryDisk(DiskAsyncPrimaryDiskArgs.builder()
                    .disk(primary.id())
                    .build())
                .physicalBlockSizeBytes(4096)
                .build());
    
        }
    }
    
    resources:
      primary:
        type: gcp:compute:Disk
        properties:
          name: async-test-disk
          type: pd-ssd
          zone: us-central1-a
          physicalBlockSizeBytes: 4096
      secondary:
        type: gcp:compute:Disk
        properties:
          name: async-secondary-test-disk
          type: pd-ssd
          zone: us-east1-c
          asyncPrimaryDisk:
            disk: ${primary.id}
          physicalBlockSizeBytes: 4096
    

    Disk Features

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const _default = new gcp.compute.Disk("default", {
        name: "test-disk-features",
        type: "pd-ssd",
        zone: "us-central1-a",
        labels: {
            environment: "dev",
        },
        guestOsFeatures: [
            {
                type: "SECURE_BOOT",
            },
            {
                type: "MULTI_IP_SUBNET",
            },
            {
                type: "WINDOWS",
            },
        ],
        licenses: ["https://www.googleapis.com/compute/v1/projects/windows-cloud/global/licenses/windows-server-core"],
        physicalBlockSizeBytes: 4096,
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    default = gcp.compute.Disk("default",
        name="test-disk-features",
        type="pd-ssd",
        zone="us-central1-a",
        labels={
            "environment": "dev",
        },
        guest_os_features=[
            {
                "type": "SECURE_BOOT",
            },
            {
                "type": "MULTI_IP_SUBNET",
            },
            {
                "type": "WINDOWS",
            },
        ],
        licenses=["https://www.googleapis.com/compute/v1/projects/windows-cloud/global/licenses/windows-server-core"],
        physical_block_size_bytes=4096)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v8/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{
    			Name: pulumi.String("test-disk-features"),
    			Type: pulumi.String("pd-ssd"),
    			Zone: pulumi.String("us-central1-a"),
    			Labels: pulumi.StringMap{
    				"environment": pulumi.String("dev"),
    			},
    			GuestOsFeatures: compute.DiskGuestOsFeatureArray{
    				&compute.DiskGuestOsFeatureArgs{
    					Type: pulumi.String("SECURE_BOOT"),
    				},
    				&compute.DiskGuestOsFeatureArgs{
    					Type: pulumi.String("MULTI_IP_SUBNET"),
    				},
    				&compute.DiskGuestOsFeatureArgs{
    					Type: pulumi.String("WINDOWS"),
    				},
    			},
    			Licenses: pulumi.StringArray{
    				pulumi.String("https://www.googleapis.com/compute/v1/projects/windows-cloud/global/licenses/windows-server-core"),
    			},
    			PhysicalBlockSizeBytes: pulumi.Int(4096),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    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()
        {
            Name = "test-disk-features",
            Type = "pd-ssd",
            Zone = "us-central1-a",
            Labels = 
            {
                { "environment", "dev" },
            },
            GuestOsFeatures = new[]
            {
                new Gcp.Compute.Inputs.DiskGuestOsFeatureArgs
                {
                    Type = "SECURE_BOOT",
                },
                new Gcp.Compute.Inputs.DiskGuestOsFeatureArgs
                {
                    Type = "MULTI_IP_SUBNET",
                },
                new Gcp.Compute.Inputs.DiskGuestOsFeatureArgs
                {
                    Type = "WINDOWS",
                },
            },
            Licenses = new[]
            {
                "https://www.googleapis.com/compute/v1/projects/windows-cloud/global/licenses/windows-server-core",
            },
            PhysicalBlockSizeBytes = 4096,
        });
    
    });
    
    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.DiskGuestOsFeatureArgs;
    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()
                .name("test-disk-features")
                .type("pd-ssd")
                .zone("us-central1-a")
                .labels(Map.of("environment", "dev"))
                .guestOsFeatures(            
                    DiskGuestOsFeatureArgs.builder()
                        .type("SECURE_BOOT")
                        .build(),
                    DiskGuestOsFeatureArgs.builder()
                        .type("MULTI_IP_SUBNET")
                        .build(),
                    DiskGuestOsFeatureArgs.builder()
                        .type("WINDOWS")
                        .build())
                .licenses("https://www.googleapis.com/compute/v1/projects/windows-cloud/global/licenses/windows-server-core")
                .physicalBlockSizeBytes(4096)
                .build());
    
        }
    }
    
    resources:
      default:
        type: gcp:compute:Disk
        properties:
          name: test-disk-features
          type: pd-ssd
          zone: us-central1-a
          labels:
            environment: dev
          guestOsFeatures:
            - type: SECURE_BOOT
            - type: MULTI_IP_SUBNET
            - type: WINDOWS
          licenses:
            - https://www.googleapis.com/compute/v1/projects/windows-cloud/global/licenses/windows-server-core
          physicalBlockSizeBytes: 4096
    

    Create Disk Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Disk(name: string, args?: DiskArgs, opts?: CustomResourceOptions);
    @overload
    def Disk(resource_name: str,
             args: Optional[DiskArgs] = None,
             opts: Optional[ResourceOptions] = None)
    
    @overload
    def Disk(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             access_mode: Optional[str] = None,
             async_primary_disk: Optional[DiskAsyncPrimaryDiskArgs] = None,
             description: Optional[str] = None,
             disk_encryption_key: Optional[DiskDiskEncryptionKeyArgs] = None,
             enable_confidential_compute: Optional[bool] = None,
             guest_os_features: Optional[Sequence[DiskGuestOsFeatureArgs]] = None,
             image: Optional[str] = None,
             interface: Optional[str] = None,
             labels: Optional[Mapping[str, str]] = None,
             licenses: Optional[Sequence[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,
             provisioned_throughput: 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,
             storage_pool: Optional[str] = None,
             type: Optional[str] = None,
             zone: Optional[str] = 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.
    
    

    Parameters

    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.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var diskResource = new Gcp.Compute.Disk("diskResource", new()
    {
        AccessMode = "string",
        AsyncPrimaryDisk = new Gcp.Compute.Inputs.DiskAsyncPrimaryDiskArgs
        {
            Disk = "string",
        },
        Description = "string",
        DiskEncryptionKey = new Gcp.Compute.Inputs.DiskDiskEncryptionKeyArgs
        {
            KmsKeySelfLink = "string",
            KmsKeyServiceAccount = "string",
            RawKey = "string",
            RsaEncryptedKey = "string",
            Sha256 = "string",
        },
        EnableConfidentialCompute = false,
        GuestOsFeatures = new[]
        {
            new Gcp.Compute.Inputs.DiskGuestOsFeatureArgs
            {
                Type = "string",
            },
        },
        Image = "string",
        Labels = 
        {
            { "string", "string" },
        },
        Licenses = new[]
        {
            "string",
        },
        MultiWriter = false,
        Name = "string",
        PhysicalBlockSizeBytes = 0,
        Project = "string",
        ProvisionedIops = 0,
        ProvisionedThroughput = 0,
        ResourcePolicies = new[]
        {
            "string",
        },
        Size = 0,
        Snapshot = "string",
        SourceDisk = "string",
        SourceImageEncryptionKey = new Gcp.Compute.Inputs.DiskSourceImageEncryptionKeyArgs
        {
            KmsKeySelfLink = "string",
            KmsKeyServiceAccount = "string",
            RawKey = "string",
            Sha256 = "string",
        },
        SourceSnapshotEncryptionKey = new Gcp.Compute.Inputs.DiskSourceSnapshotEncryptionKeyArgs
        {
            KmsKeySelfLink = "string",
            KmsKeyServiceAccount = "string",
            RawKey = "string",
            Sha256 = "string",
        },
        StoragePool = "string",
        Type = "string",
        Zone = "string",
    });
    
    example, err := compute.NewDisk(ctx, "diskResource", &compute.DiskArgs{
    	AccessMode: pulumi.String("string"),
    	AsyncPrimaryDisk: &compute.DiskAsyncPrimaryDiskArgs{
    		Disk: pulumi.String("string"),
    	},
    	Description: pulumi.String("string"),
    	DiskEncryptionKey: &compute.DiskDiskEncryptionKeyArgs{
    		KmsKeySelfLink:       pulumi.String("string"),
    		KmsKeyServiceAccount: pulumi.String("string"),
    		RawKey:               pulumi.String("string"),
    		RsaEncryptedKey:      pulumi.String("string"),
    		Sha256:               pulumi.String("string"),
    	},
    	EnableConfidentialCompute: pulumi.Bool(false),
    	GuestOsFeatures: compute.DiskGuestOsFeatureArray{
    		&compute.DiskGuestOsFeatureArgs{
    			Type: pulumi.String("string"),
    		},
    	},
    	Image: pulumi.String("string"),
    	Labels: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Licenses: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	MultiWriter:            pulumi.Bool(false),
    	Name:                   pulumi.String("string"),
    	PhysicalBlockSizeBytes: pulumi.Int(0),
    	Project:                pulumi.String("string"),
    	ProvisionedIops:        pulumi.Int(0),
    	ProvisionedThroughput:  pulumi.Int(0),
    	ResourcePolicies: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Size:       pulumi.Int(0),
    	Snapshot:   pulumi.String("string"),
    	SourceDisk: pulumi.String("string"),
    	SourceImageEncryptionKey: &compute.DiskSourceImageEncryptionKeyArgs{
    		KmsKeySelfLink:       pulumi.String("string"),
    		KmsKeyServiceAccount: pulumi.String("string"),
    		RawKey:               pulumi.String("string"),
    		Sha256:               pulumi.String("string"),
    	},
    	SourceSnapshotEncryptionKey: &compute.DiskSourceSnapshotEncryptionKeyArgs{
    		KmsKeySelfLink:       pulumi.String("string"),
    		KmsKeyServiceAccount: pulumi.String("string"),
    		RawKey:               pulumi.String("string"),
    		Sha256:               pulumi.String("string"),
    	},
    	StoragePool: pulumi.String("string"),
    	Type:        pulumi.String("string"),
    	Zone:        pulumi.String("string"),
    })
    
    var diskResource = new Disk("diskResource", DiskArgs.builder()
        .accessMode("string")
        .asyncPrimaryDisk(DiskAsyncPrimaryDiskArgs.builder()
            .disk("string")
            .build())
        .description("string")
        .diskEncryptionKey(DiskDiskEncryptionKeyArgs.builder()
            .kmsKeySelfLink("string")
            .kmsKeyServiceAccount("string")
            .rawKey("string")
            .rsaEncryptedKey("string")
            .sha256("string")
            .build())
        .enableConfidentialCompute(false)
        .guestOsFeatures(DiskGuestOsFeatureArgs.builder()
            .type("string")
            .build())
        .image("string")
        .labels(Map.of("string", "string"))
        .licenses("string")
        .multiWriter(false)
        .name("string")
        .physicalBlockSizeBytes(0)
        .project("string")
        .provisionedIops(0)
        .provisionedThroughput(0)
        .resourcePolicies("string")
        .size(0)
        .snapshot("string")
        .sourceDisk("string")
        .sourceImageEncryptionKey(DiskSourceImageEncryptionKeyArgs.builder()
            .kmsKeySelfLink("string")
            .kmsKeyServiceAccount("string")
            .rawKey("string")
            .sha256("string")
            .build())
        .sourceSnapshotEncryptionKey(DiskSourceSnapshotEncryptionKeyArgs.builder()
            .kmsKeySelfLink("string")
            .kmsKeyServiceAccount("string")
            .rawKey("string")
            .sha256("string")
            .build())
        .storagePool("string")
        .type("string")
        .zone("string")
        .build());
    
    disk_resource = gcp.compute.Disk("diskResource",
        access_mode="string",
        async_primary_disk={
            "disk": "string",
        },
        description="string",
        disk_encryption_key={
            "kmsKeySelfLink": "string",
            "kmsKeyServiceAccount": "string",
            "rawKey": "string",
            "rsaEncryptedKey": "string",
            "sha256": "string",
        },
        enable_confidential_compute=False,
        guest_os_features=[{
            "type": "string",
        }],
        image="string",
        labels={
            "string": "string",
        },
        licenses=["string"],
        multi_writer=False,
        name="string",
        physical_block_size_bytes=0,
        project="string",
        provisioned_iops=0,
        provisioned_throughput=0,
        resource_policies=["string"],
        size=0,
        snapshot="string",
        source_disk="string",
        source_image_encryption_key={
            "kmsKeySelfLink": "string",
            "kmsKeyServiceAccount": "string",
            "rawKey": "string",
            "sha256": "string",
        },
        source_snapshot_encryption_key={
            "kmsKeySelfLink": "string",
            "kmsKeyServiceAccount": "string",
            "rawKey": "string",
            "sha256": "string",
        },
        storage_pool="string",
        type="string",
        zone="string")
    
    const diskResource = new gcp.compute.Disk("diskResource", {
        accessMode: "string",
        asyncPrimaryDisk: {
            disk: "string",
        },
        description: "string",
        diskEncryptionKey: {
            kmsKeySelfLink: "string",
            kmsKeyServiceAccount: "string",
            rawKey: "string",
            rsaEncryptedKey: "string",
            sha256: "string",
        },
        enableConfidentialCompute: false,
        guestOsFeatures: [{
            type: "string",
        }],
        image: "string",
        labels: {
            string: "string",
        },
        licenses: ["string"],
        multiWriter: false,
        name: "string",
        physicalBlockSizeBytes: 0,
        project: "string",
        provisionedIops: 0,
        provisionedThroughput: 0,
        resourcePolicies: ["string"],
        size: 0,
        snapshot: "string",
        sourceDisk: "string",
        sourceImageEncryptionKey: {
            kmsKeySelfLink: "string",
            kmsKeyServiceAccount: "string",
            rawKey: "string",
            sha256: "string",
        },
        sourceSnapshotEncryptionKey: {
            kmsKeySelfLink: "string",
            kmsKeyServiceAccount: "string",
            rawKey: "string",
            sha256: "string",
        },
        storagePool: "string",
        type: "string",
        zone: "string",
    });
    
    type: gcp:compute:Disk
    properties:
        accessMode: string
        asyncPrimaryDisk:
            disk: string
        description: string
        diskEncryptionKey:
            kmsKeySelfLink: string
            kmsKeyServiceAccount: string
            rawKey: string
            rsaEncryptedKey: string
            sha256: string
        enableConfidentialCompute: false
        guestOsFeatures:
            - type: string
        image: string
        labels:
            string: string
        licenses:
            - string
        multiWriter: false
        name: string
        physicalBlockSizeBytes: 0
        project: string
        provisionedIops: 0
        provisionedThroughput: 0
        resourcePolicies:
            - string
        size: 0
        snapshot: string
        sourceDisk: string
        sourceImageEncryptionKey:
            kmsKeySelfLink: string
            kmsKeyServiceAccount: string
            rawKey: string
            sha256: string
        sourceSnapshotEncryptionKey:
            kmsKeySelfLink: string
            kmsKeyServiceAccount: string
            rawKey: string
            sha256: string
        storagePool: string
        type: string
        zone: string
    

    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:

    AccessMode string
    The accessMode of the disk. For example:

    • READ_WRITE_SINGLE
    • READ_WRITE_MANY
    • READ_ONLY_SINGLE
    AsyncPrimaryDisk DiskAsyncPrimaryDisk
    A nested object resource Structure is documented below.
    Description string
    An optional description of this resource. Provide this property when you create the resource.
    DiskEncryptionKey DiskDiskEncryptionKey
    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.
    EnableConfidentialCompute bool
    Whether this disk is using confidential compute mode. Note: Only supported on hyperdisk skus, disk_encryption_key is required when setting to true
    GuestOsFeatures List<DiskGuestOsFeature>
    A list of features to enable on the guest operating system. Applicable only for bootable disks. 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.

    Warning: interface is deprecated and will be removed in a future major release. This field is no longer used and can be safely removed from your configurations; disk interfaces are automatically determined on attachment.

    Deprecated: interface is deprecated and will be removed in a future major release. This field is no longer used and can be safely removed from your configurations; disk interfaces are automatically determined on attachment.

    Labels Dictionary<string, string>

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

    Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

    Licenses List<string>
    Any applicable license URI.
    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. Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk allows for an update of IOPS every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it
    ProvisionedThroughput int
    Indicates how much Throughput must be provisioned for the disk. Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk allows for an update of Throughput every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it
    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
    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 DiskSourceImageEncryptionKey
    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 DiskSourceSnapshotEncryptionKey
    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.
    StoragePool string
    The URL of the storage pool in which the new disk is created. For example:

    • https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/storagePools/{storagePool}
    • /projects/{project}/zones/{zone}/storagePools/{storagePool}
    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.
    AccessMode string
    The accessMode of the disk. For example:

    • READ_WRITE_SINGLE
    • READ_WRITE_MANY
    • READ_ONLY_SINGLE
    AsyncPrimaryDisk DiskAsyncPrimaryDiskArgs
    A nested object resource Structure is documented below.
    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.
    EnableConfidentialCompute bool
    Whether this disk is using confidential compute mode. Note: Only supported on hyperdisk skus, disk_encryption_key is required when setting to true
    GuestOsFeatures []DiskGuestOsFeatureArgs
    A list of features to enable on the guest operating system. Applicable only for bootable disks. 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.

    Warning: interface is deprecated and will be removed in a future major release. This field is no longer used and can be safely removed from your configurations; disk interfaces are automatically determined on attachment.

    Deprecated: interface is deprecated and will be removed in a future major release. This field is no longer used and can be safely removed from your configurations; disk interfaces are automatically determined on attachment.

    Labels map[string]string

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

    Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

    Licenses []string
    Any applicable license URI.
    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. Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk allows for an update of IOPS every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it
    ProvisionedThroughput int
    Indicates how much Throughput must be provisioned for the disk. Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk allows for an update of Throughput every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it
    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
    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.
    StoragePool string
    The URL of the storage pool in which the new disk is created. For example:

    • https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/storagePools/{storagePool}
    • /projects/{project}/zones/{zone}/storagePools/{storagePool}
    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.
    accessMode String
    The accessMode of the disk. For example:

    • READ_WRITE_SINGLE
    • READ_WRITE_MANY
    • READ_ONLY_SINGLE
    asyncPrimaryDisk DiskAsyncPrimaryDisk
    A nested object resource Structure is documented below.
    description String
    An optional description of this resource. Provide this property when you create the resource.
    diskEncryptionKey DiskDiskEncryptionKey
    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.
    enableConfidentialCompute Boolean
    Whether this disk is using confidential compute mode. Note: Only supported on hyperdisk skus, disk_encryption_key is required when setting to true
    guestOsFeatures List<DiskGuestOsFeature>
    A list of features to enable on the guest operating system. Applicable only for bootable disks. 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.

    Warning: interface is deprecated and will be removed in a future major release. This field is no longer used and can be safely removed from your configurations; disk interfaces are automatically determined on attachment.

    Deprecated: interface is deprecated and will be removed in a future major release. This field is no longer used and can be safely removed from your configurations; disk interfaces are automatically determined on attachment.

    labels Map<String,String>

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

    Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

    licenses List<String>
    Any applicable license URI.
    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. Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk allows for an update of IOPS every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it
    provisionedThroughput Integer
    Indicates how much Throughput must be provisioned for the disk. Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk allows for an update of Throughput every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it
    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
    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 DiskSourceImageEncryptionKey
    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 DiskSourceSnapshotEncryptionKey
    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.
    storagePool String
    The URL of the storage pool in which the new disk is created. For example:

    • https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/storagePools/{storagePool}
    • /projects/{project}/zones/{zone}/storagePools/{storagePool}
    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.
    accessMode string
    The accessMode of the disk. For example:

    • READ_WRITE_SINGLE
    • READ_WRITE_MANY
    • READ_ONLY_SINGLE
    asyncPrimaryDisk DiskAsyncPrimaryDisk
    A nested object resource Structure is documented below.
    description string
    An optional description of this resource. Provide this property when you create the resource.
    diskEncryptionKey DiskDiskEncryptionKey
    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.
    enableConfidentialCompute boolean
    Whether this disk is using confidential compute mode. Note: Only supported on hyperdisk skus, disk_encryption_key is required when setting to true
    guestOsFeatures DiskGuestOsFeature[]
    A list of features to enable on the guest operating system. Applicable only for bootable disks. 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.

    Warning: interface is deprecated and will be removed in a future major release. This field is no longer used and can be safely removed from your configurations; disk interfaces are automatically determined on attachment.

    Deprecated: interface is deprecated and will be removed in a future major release. This field is no longer used and can be safely removed from your configurations; disk interfaces are automatically determined on attachment.

    labels {[key: string]: string}

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

    Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

    licenses string[]
    Any applicable license URI.
    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. Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk allows for an update of IOPS every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it
    provisionedThroughput number
    Indicates how much Throughput must be provisioned for the disk. Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk allows for an update of Throughput every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it
    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
    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 DiskSourceImageEncryptionKey
    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 DiskSourceSnapshotEncryptionKey
    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.
    storagePool string
    The URL of the storage pool in which the new disk is created. For example:

    • https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/storagePools/{storagePool}
    • /projects/{project}/zones/{zone}/storagePools/{storagePool}
    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.
    access_mode str
    The accessMode of the disk. For example:

    • READ_WRITE_SINGLE
    • READ_WRITE_MANY
    • READ_ONLY_SINGLE
    async_primary_disk DiskAsyncPrimaryDiskArgs
    A nested object resource Structure is documented below.
    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.
    enable_confidential_compute bool
    Whether this disk is using confidential compute mode. Note: Only supported on hyperdisk skus, disk_encryption_key is required when setting to true
    guest_os_features Sequence[DiskGuestOsFeatureArgs]
    A list of features to enable on the guest operating system. Applicable only for bootable disks. 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.

    Warning: interface is deprecated and will be removed in a future major release. This field is no longer used and can be safely removed from your configurations; disk interfaces are automatically determined on attachment.

    Deprecated: interface is deprecated and will be removed in a future major release. This field is no longer used and can be safely removed from your configurations; disk interfaces are automatically determined on attachment.

    labels Mapping[str, str]

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

    Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

    licenses Sequence[str]
    Any applicable license URI.
    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. Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk allows for an update of IOPS every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it
    provisioned_throughput int
    Indicates how much Throughput must be provisioned for the disk. Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk allows for an update of Throughput every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it
    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
    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.
    storage_pool str
    The URL of the storage pool in which the new disk is created. For example:

    • https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/storagePools/{storagePool}
    • /projects/{project}/zones/{zone}/storagePools/{storagePool}
    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.
    accessMode String
    The accessMode of the disk. For example:

    • READ_WRITE_SINGLE
    • READ_WRITE_MANY
    • READ_ONLY_SINGLE
    asyncPrimaryDisk Property Map
    A nested object resource Structure is documented below.
    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.
    enableConfidentialCompute Boolean
    Whether this disk is using confidential compute mode. Note: Only supported on hyperdisk skus, disk_encryption_key is required when setting to true
    guestOsFeatures List<Property Map>
    A list of features to enable on the guest operating system. Applicable only for bootable disks. 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.

    Warning: interface is deprecated and will be removed in a future major release. This field is no longer used and can be safely removed from your configurations; disk interfaces are automatically determined on attachment.

    Deprecated: interface is deprecated and will be removed in a future major release. This field is no longer used and can be safely removed from your configurations; disk interfaces are automatically determined on attachment.

    labels Map<String>

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

    Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

    licenses List<String>
    Any applicable license URI.
    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. Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk allows for an update of IOPS every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it
    provisionedThroughput Number
    Indicates how much Throughput must be provisioned for the disk. Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk allows for an update of Throughput every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it
    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
    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.
    storagePool String
    The URL of the storage pool in which the new disk is created. For example:

    • https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/storagePools/{storagePool}
    • /projects/{project}/zones/{zone}/storagePools/{storagePool}
    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.
    DiskId string
    The unique identifier for the resource. This identifier is defined by the server.
    EffectiveLabels Dictionary<string, string>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    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.
    PulumiLabels Dictionary<string, string>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    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.
    DiskId string
    The unique identifier for the resource. This identifier is defined by the server.
    EffectiveLabels map[string]string
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    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.
    PulumiLabels map[string]string
    The combination of labels configured directly on the resource and default labels configured on the provider.
    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.
    diskId String
    The unique identifier for the resource. This identifier is defined by the server.
    effectiveLabels Map<String,String>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    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.
    pulumiLabels Map<String,String>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    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.
    diskId string
    The unique identifier for the resource. This identifier is defined by the server.
    effectiveLabels {[key: string]: string}
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    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.
    pulumiLabels {[key: string]: string}
    The combination of labels configured directly on the resource and default labels configured on the provider.
    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.
    disk_id str
    The unique identifier for the resource. This identifier is defined by the server.
    effective_labels Mapping[str, str]
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    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.
    pulumi_labels Mapping[str, str]
    The combination of labels configured directly on the resource and default labels configured on the provider.
    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.
    diskId String
    The unique identifier for the resource. This identifier is defined by the server.
    effectiveLabels Map<String>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    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.
    pulumiLabels Map<String>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    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,
            access_mode: Optional[str] = None,
            async_primary_disk: Optional[DiskAsyncPrimaryDiskArgs] = None,
            creation_timestamp: Optional[str] = None,
            description: Optional[str] = None,
            disk_encryption_key: Optional[DiskDiskEncryptionKeyArgs] = None,
            disk_id: Optional[str] = None,
            effective_labels: Optional[Mapping[str, str]] = None,
            enable_confidential_compute: Optional[bool] = None,
            guest_os_features: Optional[Sequence[DiskGuestOsFeatureArgs]] = 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,
            licenses: Optional[Sequence[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,
            provisioned_throughput: Optional[int] = None,
            pulumi_labels: Optional[Mapping[str, str]] = 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,
            storage_pool: 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:
    AccessMode string
    The accessMode of the disk. For example:

    • READ_WRITE_SINGLE
    • READ_WRITE_MANY
    • READ_ONLY_SINGLE
    AsyncPrimaryDisk DiskAsyncPrimaryDisk
    A nested object resource Structure is documented below.
    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 DiskDiskEncryptionKey
    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.
    DiskId string
    The unique identifier for the resource. This identifier is defined by the server.
    EffectiveLabels Dictionary<string, string>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    EnableConfidentialCompute bool
    Whether this disk is using confidential compute mode. Note: Only supported on hyperdisk skus, disk_encryption_key is required when setting to true
    GuestOsFeatures List<DiskGuestOsFeature>
    A list of features to enable on the guest operating system. Applicable only for bootable disks. 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.

    Warning: interface is deprecated and will be removed in a future major release. This field is no longer used and can be safely removed from your configurations; disk interfaces are automatically determined on attachment.

    Deprecated: interface is deprecated and will be removed in a future major release. This field is no longer used and can be safely removed from your configurations; disk interfaces are automatically determined on attachment.

    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.

    Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

    LastAttachTimestamp string
    Last attach timestamp in RFC3339 text format.
    LastDetachTimestamp string
    Last detach timestamp in RFC3339 text format.
    Licenses List<string>
    Any applicable license URI.
    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. Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk allows for an update of IOPS every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it
    ProvisionedThroughput int
    Indicates how much Throughput must be provisioned for the disk. Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk allows for an update of Throughput every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it
    PulumiLabels Dictionary<string, string>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    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
    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 DiskSourceImageEncryptionKey
    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 DiskSourceSnapshotEncryptionKey
    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.
    StoragePool string
    The URL of the storage pool in which the new disk is created. For example:

    • https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/storagePools/{storagePool}
    • /projects/{project}/zones/{zone}/storagePools/{storagePool}
    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.
    AccessMode string
    The accessMode of the disk. For example:

    • READ_WRITE_SINGLE
    • READ_WRITE_MANY
    • READ_ONLY_SINGLE
    AsyncPrimaryDisk DiskAsyncPrimaryDiskArgs
    A nested object resource Structure is documented below.
    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.
    DiskId string
    The unique identifier for the resource. This identifier is defined by the server.
    EffectiveLabels map[string]string
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    EnableConfidentialCompute bool
    Whether this disk is using confidential compute mode. Note: Only supported on hyperdisk skus, disk_encryption_key is required when setting to true
    GuestOsFeatures []DiskGuestOsFeatureArgs
    A list of features to enable on the guest operating system. Applicable only for bootable disks. 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.

    Warning: interface is deprecated and will be removed in a future major release. This field is no longer used and can be safely removed from your configurations; disk interfaces are automatically determined on attachment.

    Deprecated: interface is deprecated and will be removed in a future major release. This field is no longer used and can be safely removed from your configurations; disk interfaces are automatically determined on attachment.

    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.

    Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

    LastAttachTimestamp string
    Last attach timestamp in RFC3339 text format.
    LastDetachTimestamp string
    Last detach timestamp in RFC3339 text format.
    Licenses []string
    Any applicable license URI.
    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. Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk allows for an update of IOPS every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it
    ProvisionedThroughput int
    Indicates how much Throughput must be provisioned for the disk. Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk allows for an update of Throughput every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it
    PulumiLabels map[string]string
    The combination of labels configured directly on the resource and default labels configured on the provider.
    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
    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.
    StoragePool string
    The URL of the storage pool in which the new disk is created. For example:

    • https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/storagePools/{storagePool}
    • /projects/{project}/zones/{zone}/storagePools/{storagePool}
    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.
    accessMode String
    The accessMode of the disk. For example:

    • READ_WRITE_SINGLE
    • READ_WRITE_MANY
    • READ_ONLY_SINGLE
    asyncPrimaryDisk DiskAsyncPrimaryDisk
    A nested object resource Structure is documented below.
    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 DiskDiskEncryptionKey
    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.
    diskId String
    The unique identifier for the resource. This identifier is defined by the server.
    effectiveLabels Map<String,String>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    enableConfidentialCompute Boolean
    Whether this disk is using confidential compute mode. Note: Only supported on hyperdisk skus, disk_encryption_key is required when setting to true
    guestOsFeatures List<DiskGuestOsFeature>
    A list of features to enable on the guest operating system. Applicable only for bootable disks. 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.

    Warning: interface is deprecated and will be removed in a future major release. This field is no longer used and can be safely removed from your configurations; disk interfaces are automatically determined on attachment.

    Deprecated: interface is deprecated and will be removed in a future major release. This field is no longer used and can be safely removed from your configurations; disk interfaces are automatically determined on attachment.

    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.

    Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

    lastAttachTimestamp String
    Last attach timestamp in RFC3339 text format.
    lastDetachTimestamp String
    Last detach timestamp in RFC3339 text format.
    licenses List<String>
    Any applicable license URI.
    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. Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk allows for an update of IOPS every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it
    provisionedThroughput Integer
    Indicates how much Throughput must be provisioned for the disk. Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk allows for an update of Throughput every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it
    pulumiLabels Map<String,String>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    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
    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 DiskSourceImageEncryptionKey
    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 DiskSourceSnapshotEncryptionKey
    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.
    storagePool String
    The URL of the storage pool in which the new disk is created. For example:

    • https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/storagePools/{storagePool}
    • /projects/{project}/zones/{zone}/storagePools/{storagePool}
    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.
    accessMode string
    The accessMode of the disk. For example:

    • READ_WRITE_SINGLE
    • READ_WRITE_MANY
    • READ_ONLY_SINGLE
    asyncPrimaryDisk DiskAsyncPrimaryDisk
    A nested object resource Structure is documented below.
    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 DiskDiskEncryptionKey
    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.
    diskId string
    The unique identifier for the resource. This identifier is defined by the server.
    effectiveLabels {[key: string]: string}
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    enableConfidentialCompute boolean
    Whether this disk is using confidential compute mode. Note: Only supported on hyperdisk skus, disk_encryption_key is required when setting to true
    guestOsFeatures DiskGuestOsFeature[]
    A list of features to enable on the guest operating system. Applicable only for bootable disks. 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.

    Warning: interface is deprecated and will be removed in a future major release. This field is no longer used and can be safely removed from your configurations; disk interfaces are automatically determined on attachment.

    Deprecated: interface is deprecated and will be removed in a future major release. This field is no longer used and can be safely removed from your configurations; disk interfaces are automatically determined on attachment.

    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.

    Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

    lastAttachTimestamp string
    Last attach timestamp in RFC3339 text format.
    lastDetachTimestamp string
    Last detach timestamp in RFC3339 text format.
    licenses string[]
    Any applicable license URI.
    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. Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk allows for an update of IOPS every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it
    provisionedThroughput number
    Indicates how much Throughput must be provisioned for the disk. Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk allows for an update of Throughput every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it
    pulumiLabels {[key: string]: string}
    The combination of labels configured directly on the resource and default labels configured on the provider.
    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
    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 DiskSourceImageEncryptionKey
    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 DiskSourceSnapshotEncryptionKey
    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.
    storagePool string
    The URL of the storage pool in which the new disk is created. For example:

    • https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/storagePools/{storagePool}
    • /projects/{project}/zones/{zone}/storagePools/{storagePool}
    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.
    access_mode str
    The accessMode of the disk. For example:

    • READ_WRITE_SINGLE
    • READ_WRITE_MANY
    • READ_ONLY_SINGLE
    async_primary_disk DiskAsyncPrimaryDiskArgs
    A nested object resource Structure is documented below.
    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.
    disk_id str
    The unique identifier for the resource. This identifier is defined by the server.
    effective_labels Mapping[str, str]
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    enable_confidential_compute bool
    Whether this disk is using confidential compute mode. Note: Only supported on hyperdisk skus, disk_encryption_key is required when setting to true
    guest_os_features Sequence[DiskGuestOsFeatureArgs]
    A list of features to enable on the guest operating system. Applicable only for bootable disks. 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.

    Warning: interface is deprecated and will be removed in a future major release. This field is no longer used and can be safely removed from your configurations; disk interfaces are automatically determined on attachment.

    Deprecated: interface is deprecated and will be removed in a future major release. This field is no longer used and can be safely removed from your configurations; disk interfaces are automatically determined on attachment.

    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.

    Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

    last_attach_timestamp str
    Last attach timestamp in RFC3339 text format.
    last_detach_timestamp str
    Last detach timestamp in RFC3339 text format.
    licenses Sequence[str]
    Any applicable license URI.
    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. Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk allows for an update of IOPS every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it
    provisioned_throughput int
    Indicates how much Throughput must be provisioned for the disk. Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk allows for an update of Throughput every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it
    pulumi_labels Mapping[str, str]
    The combination of labels configured directly on the resource and default labels configured on the provider.
    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
    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.
    storage_pool str
    The URL of the storage pool in which the new disk is created. For example:

    • https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/storagePools/{storagePool}
    • /projects/{project}/zones/{zone}/storagePools/{storagePool}
    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.
    accessMode String
    The accessMode of the disk. For example:

    • READ_WRITE_SINGLE
    • READ_WRITE_MANY
    • READ_ONLY_SINGLE
    asyncPrimaryDisk Property Map
    A nested object resource Structure is documented below.
    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.
    diskId String
    The unique identifier for the resource. This identifier is defined by the server.
    effectiveLabels Map<String>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    enableConfidentialCompute Boolean
    Whether this disk is using confidential compute mode. Note: Only supported on hyperdisk skus, disk_encryption_key is required when setting to true
    guestOsFeatures List<Property Map>
    A list of features to enable on the guest operating system. Applicable only for bootable disks. 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.

    Warning: interface is deprecated and will be removed in a future major release. This field is no longer used and can be safely removed from your configurations; disk interfaces are automatically determined on attachment.

    Deprecated: interface is deprecated and will be removed in a future major release. This field is no longer used and can be safely removed from your configurations; disk interfaces are automatically determined on attachment.

    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.

    Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.

    lastAttachTimestamp String
    Last attach timestamp in RFC3339 text format.
    lastDetachTimestamp String
    Last detach timestamp in RFC3339 text format.
    licenses List<String>
    Any applicable license URI.
    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. Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk allows for an update of IOPS every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it
    provisionedThroughput Number
    Indicates how much Throughput must be provisioned for the disk. Note: Updating currently is only supported by hyperdisk skus without the need to delete and recreate the disk, hyperdisk allows for an update of Throughput every 4 hours. To update your hyperdisk more frequently, you'll need to manually delete and recreate it
    pulumiLabels Map<String>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    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
    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.
    storagePool String
    The URL of the storage pool in which the new disk is created. For example:

    • https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/storagePools/{storagePool}
    • /projects/{project}/zones/{zone}/storagePools/{storagePool}
    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, DiskAsyncPrimaryDiskArgs

    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, DiskDiskEncryptionKeyArgs

    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.

    DiskGuestOsFeature, DiskGuestOsFeatureArgs

    Type string
    The type of supported feature. Read Enabling guest operating system features to see a list of available options.
    Type string
    The type of supported feature. Read Enabling guest operating system features to see a list of available options.
    type String
    The type of supported feature. Read Enabling guest operating system features to see a list of available options.
    type string
    The type of supported feature. Read Enabling guest operating system features to see a list of available options.
    type str
    The type of supported feature. Read Enabling guest operating system features to see a list of available options.
    type String
    The type of supported feature. Read Enabling guest operating system features to see a list of available options.

    DiskSourceImageEncryptionKey, DiskSourceImageEncryptionKeyArgs

    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, DiskSourceSnapshotEncryptionKeyArgs

    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:

    • projects/{{project}}/zones/{{zone}}/disks/{{name}}

    • {{project}}/{{zone}}/{{name}}

    • {{zone}}/{{name}}

    • {{name}}

    When using the pulumi import command, Disk can be imported using one of the formats above. For example:

    $ 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}}
    

    To learn more about importing existing cloud resources, see Importing resources.

    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.
    gcp logo
    Google Cloud Classic v8.3.1 published on Wednesday, Sep 25, 2024 by Pulumi