1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. compute
  5. Disk
Google Cloud v8.26.0 published on Thursday, Apr 10, 2025 by Pulumi

gcp.compute.Disk

Explore with Pulumi AI

Persistent disks are durable storage devices that function similarly to the physical disks in a desktop or a server. Compute Engine manages the hardware behind these devices to ensure data redundancy and optimize performance for you. Persistent disks are available as either standard hard disk drives (HDD) or solid-state drives (SSD).

Persistent disks are located independently from your virtual machine instances, so you can detach or move persistent disks to keep your data even after you delete your instances. Persistent disk performance scales automatically with size, so you can resize your existing persistent disks or add more persistent disks to an instance to meet your performance and storage space requirements.

Add a persistent disk to your instance when you need reliable and affordable storage with consistent performance characteristics.

To get more information about Disk, see:

Example Usage

Disk Basic

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,
});
Copy
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)
Copy
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
	})
}
Copy
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,
    });

});
Copy
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());

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

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,
});
Copy
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)
Copy
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
	})
}
Copy
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,
    });

});
Copy
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());

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

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,
});
Copy
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)
Copy
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
	})
}
Copy
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,
    });

});
Copy
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());

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

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,
         architecture: Optional[str] = None,
         async_primary_disk: Optional[DiskAsyncPrimaryDiskArgs] = None,
         create_snapshot_before_destroy: Optional[bool] = None,
         create_snapshot_before_destroy_prefix: Optional[str] = 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,
         params: Optional[DiskParamsArgs] = 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_instant_snapshot: Optional[str] = None,
         source_snapshot_encryption_key: Optional[DiskSourceSnapshotEncryptionKeyArgs] = None,
         source_storage_object: Optional[str] = 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. String
The unique name of the resource.
args This property is required. 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",
    Architecture = "string",
    AsyncPrimaryDisk = new Gcp.Compute.Inputs.DiskAsyncPrimaryDiskArgs
    {
        Disk = "string",
    },
    CreateSnapshotBeforeDestroy = false,
    CreateSnapshotBeforeDestroyPrefix = "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",
    Params = new Gcp.Compute.Inputs.DiskParamsArgs
    {
        ResourceManagerTags = 
        {
            { "string", "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",
    },
    SourceInstantSnapshot = "string",
    SourceSnapshotEncryptionKey = new Gcp.Compute.Inputs.DiskSourceSnapshotEncryptionKeyArgs
    {
        KmsKeySelfLink = "string",
        KmsKeyServiceAccount = "string",
        RawKey = "string",
        Sha256 = "string",
    },
    SourceStorageObject = "string",
    StoragePool = "string",
    Type = "string",
    Zone = "string",
});
Copy
example, err := compute.NewDisk(ctx, "diskResource", &compute.DiskArgs{
	AccessMode:   pulumi.String("string"),
	Architecture: pulumi.String("string"),
	AsyncPrimaryDisk: &compute.DiskAsyncPrimaryDiskArgs{
		Disk: pulumi.String("string"),
	},
	CreateSnapshotBeforeDestroy:       pulumi.Bool(false),
	CreateSnapshotBeforeDestroyPrefix: 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"),
	Params: &compute.DiskParamsArgs{
		ResourceManagerTags: pulumi.StringMap{
			"string": 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"),
	},
	SourceInstantSnapshot: pulumi.String("string"),
	SourceSnapshotEncryptionKey: &compute.DiskSourceSnapshotEncryptionKeyArgs{
		KmsKeySelfLink:       pulumi.String("string"),
		KmsKeyServiceAccount: pulumi.String("string"),
		RawKey:               pulumi.String("string"),
		Sha256:               pulumi.String("string"),
	},
	SourceStorageObject: pulumi.String("string"),
	StoragePool:         pulumi.String("string"),
	Type:                pulumi.String("string"),
	Zone:                pulumi.String("string"),
})
Copy
var diskResource = new Disk("diskResource", DiskArgs.builder()
    .accessMode("string")
    .architecture("string")
    .asyncPrimaryDisk(DiskAsyncPrimaryDiskArgs.builder()
        .disk("string")
        .build())
    .createSnapshotBeforeDestroy(false)
    .createSnapshotBeforeDestroyPrefix("string")
    .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")
    .params(DiskParamsArgs.builder()
        .resourceManagerTags(Map.of("string", "string"))
        .build())
    .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())
    .sourceInstantSnapshot("string")
    .sourceSnapshotEncryptionKey(DiskSourceSnapshotEncryptionKeyArgs.builder()
        .kmsKeySelfLink("string")
        .kmsKeyServiceAccount("string")
        .rawKey("string")
        .sha256("string")
        .build())
    .sourceStorageObject("string")
    .storagePool("string")
    .type("string")
    .zone("string")
    .build());
Copy
disk_resource = gcp.compute.Disk("diskResource",
    access_mode="string",
    architecture="string",
    async_primary_disk={
        "disk": "string",
    },
    create_snapshot_before_destroy=False,
    create_snapshot_before_destroy_prefix="string",
    description="string",
    disk_encryption_key={
        "kms_key_self_link": "string",
        "kms_key_service_account": "string",
        "raw_key": "string",
        "rsa_encrypted_key": "string",
        "sha256": "string",
    },
    enable_confidential_compute=False,
    guest_os_features=[{
        "type": "string",
    }],
    image="string",
    labels={
        "string": "string",
    },
    licenses=["string"],
    multi_writer=False,
    name="string",
    params={
        "resource_manager_tags": {
            "string": "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={
        "kms_key_self_link": "string",
        "kms_key_service_account": "string",
        "raw_key": "string",
        "sha256": "string",
    },
    source_instant_snapshot="string",
    source_snapshot_encryption_key={
        "kms_key_self_link": "string",
        "kms_key_service_account": "string",
        "raw_key": "string",
        "sha256": "string",
    },
    source_storage_object="string",
    storage_pool="string",
    type="string",
    zone="string")
Copy
const diskResource = new gcp.compute.Disk("diskResource", {
    accessMode: "string",
    architecture: "string",
    asyncPrimaryDisk: {
        disk: "string",
    },
    createSnapshotBeforeDestroy: false,
    createSnapshotBeforeDestroyPrefix: "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",
    params: {
        resourceManagerTags: {
            string: "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",
    },
    sourceInstantSnapshot: "string",
    sourceSnapshotEncryptionKey: {
        kmsKeySelfLink: "string",
        kmsKeyServiceAccount: "string",
        rawKey: "string",
        sha256: "string",
    },
    sourceStorageObject: "string",
    storagePool: "string",
    type: "string",
    zone: "string",
});
Copy
type: gcp:compute:Disk
properties:
    accessMode: string
    architecture: string
    asyncPrimaryDisk:
        disk: string
    createSnapshotBeforeDestroy: false
    createSnapshotBeforeDestroyPrefix: 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
    params:
        resourceManagerTags:
            string: 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
    sourceInstantSnapshot: string
    sourceSnapshotEncryptionKey:
        kmsKeySelfLink: string
        kmsKeyServiceAccount: string
        rawKey: string
        sha256: string
    sourceStorageObject: string
    storagePool: string
    type: string
    zone: string
Copy

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

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

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
Architecture Changes to this property will trigger replacement. string
(Optional)
AsyncPrimaryDisk Changes to this property will trigger replacement. DiskAsyncPrimaryDisk
A nested object resource. Structure is documented below.
CreateSnapshotBeforeDestroy bool
If set to true, a snapshot of the disk will be created before it is destroyed. If your disk is encrypted with customer managed encryption keys these will be reused for the snapshot creation. The name of the snapshot by default will be {{disk-name}}-YYYYMMDD-HHmm
CreateSnapshotBeforeDestroyPrefix string
This will set a custom name prefix for the snapshot that's created when the disk is deleted.
Description Changes to this property will trigger replacement. string
An optional description of this resource. Provide this property when you create the resource.
DiskEncryptionKey Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. List<DiskGuestOsFeature>
A list of features to enable on the guest operating system. Applicable only for bootable disks. Structure is documented below.
Image Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. List<string>
Any applicable license URI.
MultiWriter Changes to this property will trigger replacement. bool
Indicates whether or not the disk can be read/write attached to more than one instance.
Name Changes to this property will trigger replacement. 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.


Params Changes to this property will trigger replacement. DiskParams
Additional params passed with the request, but not persisted as part of resource payload Structure is documented below.
PhysicalBlockSizeBytes Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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.
SourceInstantSnapshot Changes to this property will trigger replacement. string
The source instant snapshot used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values:

  • https://www.googleapis.com/compute/v1/projects/project/zones/zone/instantSnapshots/instantSnapshot
  • projects/project/zones/zone/instantSnapshots/instantSnapshot
  • zones/zone/instantSnapshots/instantSnapshot
SourceSnapshotEncryptionKey Changes to this property will trigger replacement. 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.
SourceStorageObject Changes to this property will trigger replacement. string
The full Google Cloud Storage URI where the disk image is stored. This file must be a gzip-compressed tarball whose name ends in .tar.gz or virtual machine disk whose name ends in vmdk. Valid URIs may start with gs:// or https://storage.googleapis.com/. This flag is not optimized for creating multiple disks from a source storage object. To create many disks from a source storage object, use gcloud compute images import instead.
StoragePool Changes to this property will trigger replacement. string
The URL or the name of the storage pool in which the new disk is created. For example:

  • https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/storagePools/{storagePool}
  • /projects/{project}/zones/{zone}/storagePools/{storagePool}
  • /zones/{zone}/storagePools/{storagePool}
  • /{storagePool}
Type Changes to this property will trigger replacement. string
URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk.
Zone Changes to this property will trigger replacement. 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
Architecture Changes to this property will trigger replacement. string
(Optional)
AsyncPrimaryDisk Changes to this property will trigger replacement. DiskAsyncPrimaryDiskArgs
A nested object resource. Structure is documented below.
CreateSnapshotBeforeDestroy bool
If set to true, a snapshot of the disk will be created before it is destroyed. If your disk is encrypted with customer managed encryption keys these will be reused for the snapshot creation. The name of the snapshot by default will be {{disk-name}}-YYYYMMDD-HHmm
CreateSnapshotBeforeDestroyPrefix string
This will set a custom name prefix for the snapshot that's created when the disk is deleted.
Description Changes to this property will trigger replacement. string
An optional description of this resource. Provide this property when you create the resource.
DiskEncryptionKey Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. []DiskGuestOsFeatureArgs
A list of features to enable on the guest operating system. Applicable only for bootable disks. Structure is documented below.
Image Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. []string
Any applicable license URI.
MultiWriter Changes to this property will trigger replacement. bool
Indicates whether or not the disk can be read/write attached to more than one instance.
Name Changes to this property will trigger replacement. 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.


Params Changes to this property will trigger replacement. DiskParamsArgs
Additional params passed with the request, but not persisted as part of resource payload Structure is documented below.
PhysicalBlockSizeBytes Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. []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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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.
SourceInstantSnapshot Changes to this property will trigger replacement. string
The source instant snapshot used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values:

  • https://www.googleapis.com/compute/v1/projects/project/zones/zone/instantSnapshots/instantSnapshot
  • projects/project/zones/zone/instantSnapshots/instantSnapshot
  • zones/zone/instantSnapshots/instantSnapshot
SourceSnapshotEncryptionKey Changes to this property will trigger replacement. 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.
SourceStorageObject Changes to this property will trigger replacement. string
The full Google Cloud Storage URI where the disk image is stored. This file must be a gzip-compressed tarball whose name ends in .tar.gz or virtual machine disk whose name ends in vmdk. Valid URIs may start with gs:// or https://storage.googleapis.com/. This flag is not optimized for creating multiple disks from a source storage object. To create many disks from a source storage object, use gcloud compute images import instead.
StoragePool Changes to this property will trigger replacement. string
The URL or the name of the storage pool in which the new disk is created. For example:

  • https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/storagePools/{storagePool}
  • /projects/{project}/zones/{zone}/storagePools/{storagePool}
  • /zones/{zone}/storagePools/{storagePool}
  • /{storagePool}
Type Changes to this property will trigger replacement. string
URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk.
Zone Changes to this property will trigger replacement. 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
architecture Changes to this property will trigger replacement. String
(Optional)
asyncPrimaryDisk Changes to this property will trigger replacement. DiskAsyncPrimaryDisk
A nested object resource. Structure is documented below.
createSnapshotBeforeDestroy Boolean
If set to true, a snapshot of the disk will be created before it is destroyed. If your disk is encrypted with customer managed encryption keys these will be reused for the snapshot creation. The name of the snapshot by default will be {{disk-name}}-YYYYMMDD-HHmm
createSnapshotBeforeDestroyPrefix String
This will set a custom name prefix for the snapshot that's created when the disk is deleted.
description Changes to this property will trigger replacement. String
An optional description of this resource. Provide this property when you create the resource.
diskEncryptionKey Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. List<DiskGuestOsFeature>
A list of features to enable on the guest operating system. Applicable only for bootable disks. Structure is documented below.
image Changes to this property will trigger replacement. 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_ Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. List<String>
Any applicable license URI.
multiWriter Changes to this property will trigger replacement. Boolean
Indicates whether or not the disk can be read/write attached to more than one instance.
name Changes to this property will trigger replacement. 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.


params Changes to this property will trigger replacement. DiskParams
Additional params passed with the request, but not persisted as part of resource payload Structure is documented below.
physicalBlockSizeBytes Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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.
sourceInstantSnapshot Changes to this property will trigger replacement. String
The source instant snapshot used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values:

  • https://www.googleapis.com/compute/v1/projects/project/zones/zone/instantSnapshots/instantSnapshot
  • projects/project/zones/zone/instantSnapshots/instantSnapshot
  • zones/zone/instantSnapshots/instantSnapshot
sourceSnapshotEncryptionKey Changes to this property will trigger replacement. 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.
sourceStorageObject Changes to this property will trigger replacement. String
The full Google Cloud Storage URI where the disk image is stored. This file must be a gzip-compressed tarball whose name ends in .tar.gz or virtual machine disk whose name ends in vmdk. Valid URIs may start with gs:// or https://storage.googleapis.com/. This flag is not optimized for creating multiple disks from a source storage object. To create many disks from a source storage object, use gcloud compute images import instead.
storagePool Changes to this property will trigger replacement. String
The URL or the name of the storage pool in which the new disk is created. For example:

  • https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/storagePools/{storagePool}
  • /projects/{project}/zones/{zone}/storagePools/{storagePool}
  • /zones/{zone}/storagePools/{storagePool}
  • /{storagePool}
type Changes to this property will trigger replacement. String
URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk.
zone Changes to this property will trigger replacement. 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
architecture Changes to this property will trigger replacement. string
(Optional)
asyncPrimaryDisk Changes to this property will trigger replacement. DiskAsyncPrimaryDisk
A nested object resource. Structure is documented below.
createSnapshotBeforeDestroy boolean
If set to true, a snapshot of the disk will be created before it is destroyed. If your disk is encrypted with customer managed encryption keys these will be reused for the snapshot creation. The name of the snapshot by default will be {{disk-name}}-YYYYMMDD-HHmm
createSnapshotBeforeDestroyPrefix string
This will set a custom name prefix for the snapshot that's created when the disk is deleted.
description Changes to this property will trigger replacement. string
An optional description of this resource. Provide this property when you create the resource.
diskEncryptionKey Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. DiskGuestOsFeature[]
A list of features to enable on the guest operating system. Applicable only for bootable disks. Structure is documented below.
image Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string[]
Any applicable license URI.
multiWriter Changes to this property will trigger replacement. boolean
Indicates whether or not the disk can be read/write attached to more than one instance.
name Changes to this property will trigger replacement. 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.


params Changes to this property will trigger replacement. DiskParams
Additional params passed with the request, but not persisted as part of resource payload Structure is documented below.
physicalBlockSizeBytes Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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.
sourceInstantSnapshot Changes to this property will trigger replacement. string
The source instant snapshot used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values:

  • https://www.googleapis.com/compute/v1/projects/project/zones/zone/instantSnapshots/instantSnapshot
  • projects/project/zones/zone/instantSnapshots/instantSnapshot
  • zones/zone/instantSnapshots/instantSnapshot
sourceSnapshotEncryptionKey Changes to this property will trigger replacement. 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.
sourceStorageObject Changes to this property will trigger replacement. string
The full Google Cloud Storage URI where the disk image is stored. This file must be a gzip-compressed tarball whose name ends in .tar.gz or virtual machine disk whose name ends in vmdk. Valid URIs may start with gs:// or https://storage.googleapis.com/. This flag is not optimized for creating multiple disks from a source storage object. To create many disks from a source storage object, use gcloud compute images import instead.
storagePool Changes to this property will trigger replacement. string
The URL or the name of the storage pool in which the new disk is created. For example:

  • https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/storagePools/{storagePool}
  • /projects/{project}/zones/{zone}/storagePools/{storagePool}
  • /zones/{zone}/storagePools/{storagePool}
  • /{storagePool}
type Changes to this property will trigger replacement. string
URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk.
zone Changes to this property will trigger replacement. 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
architecture Changes to this property will trigger replacement. str
(Optional)
async_primary_disk Changes to this property will trigger replacement. DiskAsyncPrimaryDiskArgs
A nested object resource. Structure is documented below.
create_snapshot_before_destroy bool
If set to true, a snapshot of the disk will be created before it is destroyed. If your disk is encrypted with customer managed encryption keys these will be reused for the snapshot creation. The name of the snapshot by default will be {{disk-name}}-YYYYMMDD-HHmm
create_snapshot_before_destroy_prefix str
This will set a custom name prefix for the snapshot that's created when the disk is deleted.
description Changes to this property will trigger replacement. str
An optional description of this resource. Provide this property when you create the resource.
disk_encryption_key Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. Sequence[DiskGuestOsFeatureArgs]
A list of features to enable on the guest operating system. Applicable only for bootable disks. Structure is documented below.
image Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. Sequence[str]
Any applicable license URI.
multi_writer Changes to this property will trigger replacement. bool
Indicates whether or not the disk can be read/write attached to more than one instance.
name Changes to this property will trigger replacement. 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.


params Changes to this property will trigger replacement. DiskParamsArgs
Additional params passed with the request, but not persisted as part of resource payload Structure is documented below.
physical_block_size_bytes Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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_instant_snapshot Changes to this property will trigger replacement. str
The source instant snapshot used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values:

  • https://www.googleapis.com/compute/v1/projects/project/zones/zone/instantSnapshots/instantSnapshot
  • projects/project/zones/zone/instantSnapshots/instantSnapshot
  • zones/zone/instantSnapshots/instantSnapshot
source_snapshot_encryption_key Changes to this property will trigger replacement. 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_storage_object Changes to this property will trigger replacement. str
The full Google Cloud Storage URI where the disk image is stored. This file must be a gzip-compressed tarball whose name ends in .tar.gz or virtual machine disk whose name ends in vmdk. Valid URIs may start with gs:// or https://storage.googleapis.com/. This flag is not optimized for creating multiple disks from a source storage object. To create many disks from a source storage object, use gcloud compute images import instead.
storage_pool Changes to this property will trigger replacement. str
The URL or the name of the storage pool in which the new disk is created. For example:

  • https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/storagePools/{storagePool}
  • /projects/{project}/zones/{zone}/storagePools/{storagePool}
  • /zones/{zone}/storagePools/{storagePool}
  • /{storagePool}
type Changes to this property will trigger replacement. str
URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk.
zone Changes to this property will trigger replacement. 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
architecture Changes to this property will trigger replacement. String
(Optional)
asyncPrimaryDisk Changes to this property will trigger replacement. Property Map
A nested object resource. Structure is documented below.
createSnapshotBeforeDestroy Boolean
If set to true, a snapshot of the disk will be created before it is destroyed. If your disk is encrypted with customer managed encryption keys these will be reused for the snapshot creation. The name of the snapshot by default will be {{disk-name}}-YYYYMMDD-HHmm
createSnapshotBeforeDestroyPrefix String
This will set a custom name prefix for the snapshot that's created when the disk is deleted.
description Changes to this property will trigger replacement. String
An optional description of this resource. Provide this property when you create the resource.
diskEncryptionKey Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. List<Property Map>
A list of features to enable on the guest operating system. Applicable only for bootable disks. Structure is documented below.
image Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. List<String>
Any applicable license URI.
multiWriter Changes to this property will trigger replacement. Boolean
Indicates whether or not the disk can be read/write attached to more than one instance.
name Changes to this property will trigger replacement. 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.


params Changes to this property will trigger replacement. Property Map
Additional params passed with the request, but not persisted as part of resource payload Structure is documented below.
physicalBlockSizeBytes Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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.
sourceInstantSnapshot Changes to this property will trigger replacement. String
The source instant snapshot used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values:

  • https://www.googleapis.com/compute/v1/projects/project/zones/zone/instantSnapshots/instantSnapshot
  • projects/project/zones/zone/instantSnapshots/instantSnapshot
  • zones/zone/instantSnapshots/instantSnapshot
sourceSnapshotEncryptionKey Changes to this property will trigger replacement. 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.
sourceStorageObject Changes to this property will trigger replacement. String
The full Google Cloud Storage URI where the disk image is stored. This file must be a gzip-compressed tarball whose name ends in .tar.gz or virtual machine disk whose name ends in vmdk. Valid URIs may start with gs:// or https://storage.googleapis.com/. This flag is not optimized for creating multiple disks from a source storage object. To create many disks from a source storage object, use gcloud compute images import instead.
storagePool Changes to this property will trigger replacement. String
The URL or the name of the storage pool in which the new disk is created. For example:

  • https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/storagePools/{storagePool}
  • /projects/{project}/zones/{zone}/storagePools/{storagePool}
  • /zones/{zone}/storagePools/{storagePool}
  • /{storagePool}
type Changes to this property will trigger replacement. String
URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk.
zone Changes to this property will trigger replacement. 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.
SourceInstantSnapshotId string
The unique ID of the instant snapshot used to create this disk. This value identifies the exact instant snapshot that was used to create this persistent disk. For example, if you created the persistent disk from an instant snapshot that was later deleted and recreated under the same name, the source instant snapshot ID would identify the exact version of the instant snapshot that was used.
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.
SourceInstantSnapshotId string
The unique ID of the instant snapshot used to create this disk. This value identifies the exact instant snapshot that was used to create this persistent disk. For example, if you created the persistent disk from an instant snapshot that was later deleted and recreated under the same name, the source instant snapshot ID would identify the exact version of the instant snapshot that was used.
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.
sourceInstantSnapshotId String
The unique ID of the instant snapshot used to create this disk. This value identifies the exact instant snapshot that was used to create this persistent disk. For example, if you created the persistent disk from an instant snapshot that was later deleted and recreated under the same name, the source instant snapshot ID would identify the exact version of the instant snapshot that was used.
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.
sourceInstantSnapshotId string
The unique ID of the instant snapshot used to create this disk. This value identifies the exact instant snapshot that was used to create this persistent disk. For example, if you created the persistent disk from an instant snapshot that was later deleted and recreated under the same name, the source instant snapshot ID would identify the exact version of the instant snapshot that was used.
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_instant_snapshot_id str
The unique ID of the instant snapshot used to create this disk. This value identifies the exact instant snapshot that was used to create this persistent disk. For example, if you created the persistent disk from an instant snapshot that was later deleted and recreated under the same name, the source instant snapshot ID would identify the exact version of the instant snapshot that was used.
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.
sourceInstantSnapshotId String
The unique ID of the instant snapshot used to create this disk. This value identifies the exact instant snapshot that was used to create this persistent disk. For example, if you created the persistent disk from an instant snapshot that was later deleted and recreated under the same name, the source instant snapshot ID would identify the exact version of the instant snapshot that was used.
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,
        architecture: Optional[str] = None,
        async_primary_disk: Optional[DiskAsyncPrimaryDiskArgs] = None,
        create_snapshot_before_destroy: Optional[bool] = None,
        create_snapshot_before_destroy_prefix: Optional[str] = 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,
        params: Optional[DiskParamsArgs] = 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_instant_snapshot: Optional[str] = None,
        source_instant_snapshot_id: Optional[str] = None,
        source_snapshot_encryption_key: Optional[DiskSourceSnapshotEncryptionKeyArgs] = None,
        source_snapshot_id: Optional[str] = None,
        source_storage_object: 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)
resources:  _:    type: gcp:compute:Disk    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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
Architecture Changes to this property will trigger replacement. string
(Optional)
AsyncPrimaryDisk Changes to this property will trigger replacement. DiskAsyncPrimaryDisk
A nested object resource. Structure is documented below.
CreateSnapshotBeforeDestroy bool
If set to true, a snapshot of the disk will be created before it is destroyed. If your disk is encrypted with customer managed encryption keys these will be reused for the snapshot creation. The name of the snapshot by default will be {{disk-name}}-YYYYMMDD-HHmm
CreateSnapshotBeforeDestroyPrefix string
This will set a custom name prefix for the snapshot that's created when the disk is deleted.
CreationTimestamp string
Creation timestamp in RFC3339 text format.
Description Changes to this property will trigger replacement. string
An optional description of this resource. Provide this property when you create the resource.
DiskEncryptionKey Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. List<DiskGuestOsFeature>
A list of features to enable on the guest operating system. Applicable only for bootable disks. Structure is documented below.
Image Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. List<string>
Any applicable license URI.
MultiWriter Changes to this property will trigger replacement. bool
Indicates whether or not the disk can be read/write attached to more than one instance.
Name Changes to this property will trigger replacement. 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.


Params Changes to this property will trigger replacement. DiskParams
Additional params passed with the request, but not persisted as part of resource payload Structure is documented below.
PhysicalBlockSizeBytes Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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.
SourceInstantSnapshot Changes to this property will trigger replacement. string
The source instant snapshot used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values:

  • https://www.googleapis.com/compute/v1/projects/project/zones/zone/instantSnapshots/instantSnapshot
  • projects/project/zones/zone/instantSnapshots/instantSnapshot
  • zones/zone/instantSnapshots/instantSnapshot
SourceInstantSnapshotId string
The unique ID of the instant snapshot used to create this disk. This value identifies the exact instant snapshot that was used to create this persistent disk. For example, if you created the persistent disk from an instant snapshot that was later deleted and recreated under the same name, the source instant snapshot ID would identify the exact version of the instant snapshot that was used.
SourceSnapshotEncryptionKey Changes to this property will trigger replacement. 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.
SourceStorageObject Changes to this property will trigger replacement. string
The full Google Cloud Storage URI where the disk image is stored. This file must be a gzip-compressed tarball whose name ends in .tar.gz or virtual machine disk whose name ends in vmdk. Valid URIs may start with gs:// or https://storage.googleapis.com/. This flag is not optimized for creating multiple disks from a source storage object. To create many disks from a source storage object, use gcloud compute images import instead.
StoragePool Changes to this property will trigger replacement. string
The URL or the name of the storage pool in which the new disk is created. For example:

  • https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/storagePools/{storagePool}
  • /projects/{project}/zones/{zone}/storagePools/{storagePool}
  • /zones/{zone}/storagePools/{storagePool}
  • /{storagePool}
Type Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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
Architecture Changes to this property will trigger replacement. string
(Optional)
AsyncPrimaryDisk Changes to this property will trigger replacement. DiskAsyncPrimaryDiskArgs
A nested object resource. Structure is documented below.
CreateSnapshotBeforeDestroy bool
If set to true, a snapshot of the disk will be created before it is destroyed. If your disk is encrypted with customer managed encryption keys these will be reused for the snapshot creation. The name of the snapshot by default will be {{disk-name}}-YYYYMMDD-HHmm
CreateSnapshotBeforeDestroyPrefix string
This will set a custom name prefix for the snapshot that's created when the disk is deleted.
CreationTimestamp string
Creation timestamp in RFC3339 text format.
Description Changes to this property will trigger replacement. string
An optional description of this resource. Provide this property when you create the resource.
DiskEncryptionKey Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. []DiskGuestOsFeatureArgs
A list of features to enable on the guest operating system. Applicable only for bootable disks. Structure is documented below.
Image Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. []string
Any applicable license URI.
MultiWriter Changes to this property will trigger replacement. bool
Indicates whether or not the disk can be read/write attached to more than one instance.
Name Changes to this property will trigger replacement. 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.


Params Changes to this property will trigger replacement. DiskParamsArgs
Additional params passed with the request, but not persisted as part of resource payload Structure is documented below.
PhysicalBlockSizeBytes Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. []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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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.
SourceInstantSnapshot Changes to this property will trigger replacement. string
The source instant snapshot used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values:

  • https://www.googleapis.com/compute/v1/projects/project/zones/zone/instantSnapshots/instantSnapshot
  • projects/project/zones/zone/instantSnapshots/instantSnapshot
  • zones/zone/instantSnapshots/instantSnapshot
SourceInstantSnapshotId string
The unique ID of the instant snapshot used to create this disk. This value identifies the exact instant snapshot that was used to create this persistent disk. For example, if you created the persistent disk from an instant snapshot that was later deleted and recreated under the same name, the source instant snapshot ID would identify the exact version of the instant snapshot that was used.
SourceSnapshotEncryptionKey Changes to this property will trigger replacement. 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.
SourceStorageObject Changes to this property will trigger replacement. string
The full Google Cloud Storage URI where the disk image is stored. This file must be a gzip-compressed tarball whose name ends in .tar.gz or virtual machine disk whose name ends in vmdk. Valid URIs may start with gs:// or https://storage.googleapis.com/. This flag is not optimized for creating multiple disks from a source storage object. To create many disks from a source storage object, use gcloud compute images import instead.
StoragePool Changes to this property will trigger replacement. string
The URL or the name of the storage pool in which the new disk is created. For example:

  • https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/storagePools/{storagePool}
  • /projects/{project}/zones/{zone}/storagePools/{storagePool}
  • /zones/{zone}/storagePools/{storagePool}
  • /{storagePool}
Type Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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
architecture Changes to this property will trigger replacement. String
(Optional)
asyncPrimaryDisk Changes to this property will trigger replacement. DiskAsyncPrimaryDisk
A nested object resource. Structure is documented below.
createSnapshotBeforeDestroy Boolean
If set to true, a snapshot of the disk will be created before it is destroyed. If your disk is encrypted with customer managed encryption keys these will be reused for the snapshot creation. The name of the snapshot by default will be {{disk-name}}-YYYYMMDD-HHmm
createSnapshotBeforeDestroyPrefix String
This will set a custom name prefix for the snapshot that's created when the disk is deleted.
creationTimestamp String
Creation timestamp in RFC3339 text format.
description Changes to this property will trigger replacement. String
An optional description of this resource. Provide this property when you create the resource.
diskEncryptionKey Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. List<DiskGuestOsFeature>
A list of features to enable on the guest operating system. Applicable only for bootable disks. Structure is documented below.
image Changes to this property will trigger replacement. 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_ Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. List<String>
Any applicable license URI.
multiWriter Changes to this property will trigger replacement. Boolean
Indicates whether or not the disk can be read/write attached to more than one instance.
name Changes to this property will trigger replacement. 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.


params Changes to this property will trigger replacement. DiskParams
Additional params passed with the request, but not persisted as part of resource payload Structure is documented below.
physicalBlockSizeBytes Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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.
sourceInstantSnapshot Changes to this property will trigger replacement. String
The source instant snapshot used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values:

  • https://www.googleapis.com/compute/v1/projects/project/zones/zone/instantSnapshots/instantSnapshot
  • projects/project/zones/zone/instantSnapshots/instantSnapshot
  • zones/zone/instantSnapshots/instantSnapshot
sourceInstantSnapshotId String
The unique ID of the instant snapshot used to create this disk. This value identifies the exact instant snapshot that was used to create this persistent disk. For example, if you created the persistent disk from an instant snapshot that was later deleted and recreated under the same name, the source instant snapshot ID would identify the exact version of the instant snapshot that was used.
sourceSnapshotEncryptionKey Changes to this property will trigger replacement. 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.
sourceStorageObject Changes to this property will trigger replacement. String
The full Google Cloud Storage URI where the disk image is stored. This file must be a gzip-compressed tarball whose name ends in .tar.gz or virtual machine disk whose name ends in vmdk. Valid URIs may start with gs:// or https://storage.googleapis.com/. This flag is not optimized for creating multiple disks from a source storage object. To create many disks from a source storage object, use gcloud compute images import instead.
storagePool Changes to this property will trigger replacement. String
The URL or the name of the storage pool in which the new disk is created. For example:

  • https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/storagePools/{storagePool}
  • /projects/{project}/zones/{zone}/storagePools/{storagePool}
  • /zones/{zone}/storagePools/{storagePool}
  • /{storagePool}
type Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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
architecture Changes to this property will trigger replacement. string
(Optional)
asyncPrimaryDisk Changes to this property will trigger replacement. DiskAsyncPrimaryDisk
A nested object resource. Structure is documented below.
createSnapshotBeforeDestroy boolean
If set to true, a snapshot of the disk will be created before it is destroyed. If your disk is encrypted with customer managed encryption keys these will be reused for the snapshot creation. The name of the snapshot by default will be {{disk-name}}-YYYYMMDD-HHmm
createSnapshotBeforeDestroyPrefix string
This will set a custom name prefix for the snapshot that's created when the disk is deleted.
creationTimestamp string
Creation timestamp in RFC3339 text format.
description Changes to this property will trigger replacement. string
An optional description of this resource. Provide this property when you create the resource.
diskEncryptionKey Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. DiskGuestOsFeature[]
A list of features to enable on the guest operating system. Applicable only for bootable disks. Structure is documented below.
image Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string[]
Any applicable license URI.
multiWriter Changes to this property will trigger replacement. boolean
Indicates whether or not the disk can be read/write attached to more than one instance.
name Changes to this property will trigger replacement. 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.


params Changes to this property will trigger replacement. DiskParams
Additional params passed with the request, but not persisted as part of resource payload Structure is documented below.
physicalBlockSizeBytes Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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.
sourceInstantSnapshot Changes to this property will trigger replacement. string
The source instant snapshot used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values:

  • https://www.googleapis.com/compute/v1/projects/project/zones/zone/instantSnapshots/instantSnapshot
  • projects/project/zones/zone/instantSnapshots/instantSnapshot
  • zones/zone/instantSnapshots/instantSnapshot
sourceInstantSnapshotId string
The unique ID of the instant snapshot used to create this disk. This value identifies the exact instant snapshot that was used to create this persistent disk. For example, if you created the persistent disk from an instant snapshot that was later deleted and recreated under the same name, the source instant snapshot ID would identify the exact version of the instant snapshot that was used.
sourceSnapshotEncryptionKey Changes to this property will trigger replacement. 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.
sourceStorageObject Changes to this property will trigger replacement. string
The full Google Cloud Storage URI where the disk image is stored. This file must be a gzip-compressed tarball whose name ends in .tar.gz or virtual machine disk whose name ends in vmdk. Valid URIs may start with gs:// or https://storage.googleapis.com/. This flag is not optimized for creating multiple disks from a source storage object. To create many disks from a source storage object, use gcloud compute images import instead.
storagePool Changes to this property will trigger replacement. string
The URL or the name of the storage pool in which the new disk is created. For example:

  • https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/storagePools/{storagePool}
  • /projects/{project}/zones/{zone}/storagePools/{storagePool}
  • /zones/{zone}/storagePools/{storagePool}
  • /{storagePool}
type Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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
architecture Changes to this property will trigger replacement. str
(Optional)
async_primary_disk Changes to this property will trigger replacement. DiskAsyncPrimaryDiskArgs
A nested object resource. Structure is documented below.
create_snapshot_before_destroy bool
If set to true, a snapshot of the disk will be created before it is destroyed. If your disk is encrypted with customer managed encryption keys these will be reused for the snapshot creation. The name of the snapshot by default will be {{disk-name}}-YYYYMMDD-HHmm
create_snapshot_before_destroy_prefix str
This will set a custom name prefix for the snapshot that's created when the disk is deleted.
creation_timestamp str
Creation timestamp in RFC3339 text format.
description Changes to this property will trigger replacement. str
An optional description of this resource. Provide this property when you create the resource.
disk_encryption_key Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. Sequence[DiskGuestOsFeatureArgs]
A list of features to enable on the guest operating system. Applicable only for bootable disks. Structure is documented below.
image Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. Sequence[str]
Any applicable license URI.
multi_writer Changes to this property will trigger replacement. bool
Indicates whether or not the disk can be read/write attached to more than one instance.
name Changes to this property will trigger replacement. 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.


params Changes to this property will trigger replacement. DiskParamsArgs
Additional params passed with the request, but not persisted as part of resource payload Structure is documented below.
physical_block_size_bytes Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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_instant_snapshot Changes to this property will trigger replacement. str
The source instant snapshot used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values:

  • https://www.googleapis.com/compute/v1/projects/project/zones/zone/instantSnapshots/instantSnapshot
  • projects/project/zones/zone/instantSnapshots/instantSnapshot
  • zones/zone/instantSnapshots/instantSnapshot
source_instant_snapshot_id str
The unique ID of the instant snapshot used to create this disk. This value identifies the exact instant snapshot that was used to create this persistent disk. For example, if you created the persistent disk from an instant snapshot that was later deleted and recreated under the same name, the source instant snapshot ID would identify the exact version of the instant snapshot that was used.
source_snapshot_encryption_key Changes to this property will trigger replacement. 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.
source_storage_object Changes to this property will trigger replacement. str
The full Google Cloud Storage URI where the disk image is stored. This file must be a gzip-compressed tarball whose name ends in .tar.gz or virtual machine disk whose name ends in vmdk. Valid URIs may start with gs:// or https://storage.googleapis.com/. This flag is not optimized for creating multiple disks from a source storage object. To create many disks from a source storage object, use gcloud compute images import instead.
storage_pool Changes to this property will trigger replacement. str
The URL or the name of the storage pool in which the new disk is created. For example:

  • https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/storagePools/{storagePool}
  • /projects/{project}/zones/{zone}/storagePools/{storagePool}
  • /zones/{zone}/storagePools/{storagePool}
  • /{storagePool}
type Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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
architecture Changes to this property will trigger replacement. String
(Optional)
asyncPrimaryDisk Changes to this property will trigger replacement. Property Map
A nested object resource. Structure is documented below.
createSnapshotBeforeDestroy Boolean
If set to true, a snapshot of the disk will be created before it is destroyed. If your disk is encrypted with customer managed encryption keys these will be reused for the snapshot creation. The name of the snapshot by default will be {{disk-name}}-YYYYMMDD-HHmm
createSnapshotBeforeDestroyPrefix String
This will set a custom name prefix for the snapshot that's created when the disk is deleted.
creationTimestamp String
Creation timestamp in RFC3339 text format.
description Changes to this property will trigger replacement. String
An optional description of this resource. Provide this property when you create the resource.
diskEncryptionKey Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. List<Property Map>
A list of features to enable on the guest operating system. Applicable only for bootable disks. Structure is documented below.
image Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. List<String>
Any applicable license URI.
multiWriter Changes to this property will trigger replacement. Boolean
Indicates whether or not the disk can be read/write attached to more than one instance.
name Changes to this property will trigger replacement. 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.


params Changes to this property will trigger replacement. Property Map
Additional params passed with the request, but not persisted as part of resource payload Structure is documented below.
physicalBlockSizeBytes Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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.
sourceInstantSnapshot Changes to this property will trigger replacement. String
The source instant snapshot used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values:

  • https://www.googleapis.com/compute/v1/projects/project/zones/zone/instantSnapshots/instantSnapshot
  • projects/project/zones/zone/instantSnapshots/instantSnapshot
  • zones/zone/instantSnapshots/instantSnapshot
sourceInstantSnapshotId String
The unique ID of the instant snapshot used to create this disk. This value identifies the exact instant snapshot that was used to create this persistent disk. For example, if you created the persistent disk from an instant snapshot that was later deleted and recreated under the same name, the source instant snapshot ID would identify the exact version of the instant snapshot that was used.
sourceSnapshotEncryptionKey Changes to this property will trigger replacement. 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.
sourceStorageObject Changes to this property will trigger replacement. String
The full Google Cloud Storage URI where the disk image is stored. This file must be a gzip-compressed tarball whose name ends in .tar.gz or virtual machine disk whose name ends in vmdk. Valid URIs may start with gs:// or https://storage.googleapis.com/. This flag is not optimized for creating multiple disks from a source storage object. To create many disks from a source storage object, use gcloud compute images import instead.
storagePool Changes to this property will trigger replacement. String
The URL or the name of the storage pool in which the new disk is created. For example:

  • https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/storagePools/{storagePool}
  • /projects/{project}/zones/{zone}/storagePools/{storagePool}
  • /zones/{zone}/storagePools/{storagePool}
  • /{storagePool}
type Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. String
A reference to the zone where the disk resides.

Supporting Types

DiskAsyncPrimaryDisk
, DiskAsyncPrimaryDiskArgs

Disk
This property is required.
Changes to this property will trigger replacement.
string
Primary disk for asynchronous disk replication.
Disk
This property is required.
Changes to this property will trigger replacement.
string
Primary disk for asynchronous disk replication.
disk
This property is required.
Changes to this property will trigger replacement.
String
Primary disk for asynchronous disk replication.
disk
This property is required.
Changes to this property will trigger replacement.
string
Primary disk for asynchronous disk replication.
disk
This property is required.
Changes to this property will trigger replacement.
str
Primary disk for asynchronous disk replication.
disk
This property is required.
Changes to this property will trigger replacement.
String
Primary disk for asynchronous disk replication.

DiskDiskEncryptionKey
, DiskDiskEncryptionKeyArgs

KmsKeySelfLink Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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
This property is required.
Changes to this property will trigger replacement.
string
The type of supported feature. Read Enabling guest operating system features to see a list of available options.
Type
This property is required.
Changes to this property will trigger replacement.
string
The type of supported feature. Read Enabling guest operating system features to see a list of available options.
type
This property is required.
Changes to this property will trigger replacement.
String
The type of supported feature. Read Enabling guest operating system features to see a list of available options.
type
This property is required.
Changes to this property will trigger replacement.
string
The type of supported feature. Read Enabling guest operating system features to see a list of available options.
type
This property is required.
Changes to this property will trigger replacement.
str
The type of supported feature. Read Enabling guest operating system features to see a list of available options.
type
This property is required.
Changes to this property will trigger replacement.
String
The type of supported feature. Read Enabling guest operating system features to see a list of available options.

DiskParams
, DiskParamsArgs

ResourceManagerTags Changes to this property will trigger replacement. Dictionary<string, string>
Resource manager tags to be bound to the disk. Tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456.
ResourceManagerTags Changes to this property will trigger replacement. map[string]string
Resource manager tags to be bound to the disk. Tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456.
resourceManagerTags Changes to this property will trigger replacement. Map<String,String>
Resource manager tags to be bound to the disk. Tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456.
resourceManagerTags Changes to this property will trigger replacement. {[key: string]: string}
Resource manager tags to be bound to the disk. Tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456.
resource_manager_tags Changes to this property will trigger replacement. Mapping[str, str]
Resource manager tags to be bound to the disk. Tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456.
resourceManagerTags Changes to this property will trigger replacement. Map<String>
Resource manager tags to be bound to the disk. Tag keys and values have the same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456.

DiskSourceImageEncryptionKey
, DiskSourceImageEncryptionKeyArgs

KmsKeySelfLink Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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}}
Copy
$ pulumi import gcp:compute/disk:Disk default {{project}}/{{zone}}/{{name}}
Copy
$ pulumi import gcp:compute/disk:Disk default {{zone}}/{{name}}
Copy
$ pulumi import gcp:compute/disk:Disk default {{name}}
Copy

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.