Google Cloud Classic v6.57.0, May 30 23
Google Cloud Classic v6.57.0, May 30 23
gcp.compute.Disk
Explore with Pulumi AI
Persistent disks are durable storage devices that function similarly to the physical disks in a desktop or a server. Compute Engine manages the hardware behind these devices to ensure data redundancy and optimize performance for you. Persistent disks are available as either standard hard disk drives (HDD) or solid-state drives (SSD).
Persistent disks are located independently from your virtual machine instances, so you can detach or move persistent disks to keep your data even after you delete your instances. Persistent disk performance scales automatically with size, so you can resize your existing persistent disks or add more persistent disks to an instance to meet your performance and storage space requirements.
Add a persistent disk to your instance when you need reliable and affordable storage with consistent performance characteristics.
To get more information about Disk, see:
- API documentation
- How-to Guides
Example Usage
Disk Basic
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var @default = new Gcp.Compute.Disk("default", new()
{
Image = "debian-11-bullseye-v20220719",
Labels =
{
{ "environment", "dev" },
},
PhysicalBlockSizeBytes = 4096,
Type = "pd-ssd",
Zone = "us-central1-a",
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/compute"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := compute.NewDisk(ctx, "default", &compute.DiskArgs{
Image: pulumi.String("debian-11-bullseye-v20220719"),
Labels: pulumi.StringMap{
"environment": pulumi.String("dev"),
},
PhysicalBlockSizeBytes: pulumi.Int(4096),
Type: pulumi.String("pd-ssd"),
Zone: pulumi.String("us-central1-a"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.Disk;
import com.pulumi.gcp.compute.DiskArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var default_ = new Disk("default", DiskArgs.builder()
.image("debian-11-bullseye-v20220719")
.labels(Map.of("environment", "dev"))
.physicalBlockSizeBytes(4096)
.type("pd-ssd")
.zone("us-central1-a")
.build());
}
}
import pulumi
import pulumi_gcp as gcp
default = gcp.compute.Disk("default",
image="debian-11-bullseye-v20220719",
labels={
"environment": "dev",
},
physical_block_size_bytes=4096,
type="pd-ssd",
zone="us-central1-a")
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const _default = new gcp.compute.Disk("default", {
image: "debian-11-bullseye-v20220719",
labels: {
environment: "dev",
},
physicalBlockSizeBytes: 4096,
type: "pd-ssd",
zone: "us-central1-a",
});
resources:
default:
type: gcp:compute:Disk
properties:
image: debian-11-bullseye-v20220719
labels:
environment: dev
physicalBlockSizeBytes: 4096
type: pd-ssd
zone: us-central1-a
Disk Async
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var primary = new Gcp.Compute.Disk("primary", new()
{
Type = "pd-ssd",
Zone = "us-central1-a",
PhysicalBlockSizeBytes = 4096,
}, new CustomResourceOptions
{
Provider = google_beta,
});
var secondary = new Gcp.Compute.Disk("secondary", new()
{
Type = "pd-ssd",
Zone = "us-east1-c",
AsyncPrimaryDisk = new Gcp.Compute.Inputs.DiskAsyncPrimaryDiskArgs
{
Disk = primary.Id,
},
PhysicalBlockSizeBytes = 4096,
}, new CustomResourceOptions
{
Provider = google_beta,
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/compute"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
primary, err := compute.NewDisk(ctx, "primary", &compute.DiskArgs{
Type: pulumi.String("pd-ssd"),
Zone: pulumi.String("us-central1-a"),
PhysicalBlockSizeBytes: pulumi.Int(4096),
}, pulumi.Provider(google_beta))
if err != nil {
return err
}
_, err = compute.NewDisk(ctx, "secondary", &compute.DiskArgs{
Type: pulumi.String("pd-ssd"),
Zone: pulumi.String("us-east1-c"),
AsyncPrimaryDisk: &compute.DiskAsyncPrimaryDiskArgs{
Disk: primary.ID(),
},
PhysicalBlockSizeBytes: pulumi.Int(4096),
}, pulumi.Provider(google_beta))
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.Disk;
import com.pulumi.gcp.compute.DiskArgs;
import com.pulumi.gcp.compute.inputs.DiskAsyncPrimaryDiskArgs;
import com.pulumi.resources.CustomResourceOptions;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var primary = new Disk("primary", DiskArgs.builder()
.type("pd-ssd")
.zone("us-central1-a")
.physicalBlockSizeBytes(4096)
.build(), CustomResourceOptions.builder()
.provider(google_beta)
.build());
var secondary = new Disk("secondary", DiskArgs.builder()
.type("pd-ssd")
.zone("us-east1-c")
.asyncPrimaryDisk(DiskAsyncPrimaryDiskArgs.builder()
.disk(primary.id())
.build())
.physicalBlockSizeBytes(4096)
.build(), CustomResourceOptions.builder()
.provider(google_beta)
.build());
}
}
import pulumi
import pulumi_gcp as gcp
primary = gcp.compute.Disk("primary",
type="pd-ssd",
zone="us-central1-a",
physical_block_size_bytes=4096,
opts=pulumi.ResourceOptions(provider=google_beta))
secondary = gcp.compute.Disk("secondary",
type="pd-ssd",
zone="us-east1-c",
async_primary_disk=gcp.compute.DiskAsyncPrimaryDiskArgs(
disk=primary.id,
),
physical_block_size_bytes=4096,
opts=pulumi.ResourceOptions(provider=google_beta))
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const primary = new gcp.compute.Disk("primary", {
type: "pd-ssd",
zone: "us-central1-a",
physicalBlockSizeBytes: 4096,
}, {
provider: google_beta,
});
const secondary = new gcp.compute.Disk("secondary", {
type: "pd-ssd",
zone: "us-east1-c",
asyncPrimaryDisk: {
disk: primary.id,
},
physicalBlockSizeBytes: 4096,
}, {
provider: google_beta,
});
resources:
primary:
type: gcp:compute:Disk
properties:
type: pd-ssd
zone: us-central1-a
physicalBlockSizeBytes: 4096
options:
provider: ${["google-beta"]}
secondary:
type: gcp:compute:Disk
properties:
type: pd-ssd
zone: us-east1-c
asyncPrimaryDisk:
disk: ${primary.id}
physicalBlockSizeBytes: 4096
options:
provider: ${["google-beta"]}
Create Disk Resource
new Disk(name: string, args?: DiskArgs, opts?: CustomResourceOptions);
@overload
def Disk(resource_name: str,
opts: Optional[ResourceOptions] = None,
async_primary_disk: Optional[DiskAsyncPrimaryDiskArgs] = None,
description: Optional[str] = None,
disk_encryption_key: Optional[DiskDiskEncryptionKeyArgs] = None,
image: Optional[str] = None,
interface: Optional[str] = None,
labels: Optional[Mapping[str, str]] = None,
multi_writer: Optional[bool] = None,
name: Optional[str] = None,
physical_block_size_bytes: Optional[int] = None,
project: Optional[str] = None,
provisioned_iops: Optional[int] = None,
resource_policies: Optional[Sequence[str]] = None,
size: Optional[int] = None,
snapshot: Optional[str] = None,
source_disk: Optional[str] = None,
source_image_encryption_key: Optional[DiskSourceImageEncryptionKeyArgs] = None,
source_snapshot_encryption_key: Optional[DiskSourceSnapshotEncryptionKeyArgs] = None,
type: Optional[str] = None,
zone: Optional[str] = None)
@overload
def Disk(resource_name: str,
args: Optional[DiskArgs] = None,
opts: Optional[ResourceOptions] = None)
func NewDisk(ctx *Context, name string, args *DiskArgs, opts ...ResourceOption) (*Disk, error)
public Disk(string name, DiskArgs? args = null, CustomResourceOptions? opts = null)
type: gcp:compute:Disk
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DiskArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args DiskArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args DiskArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DiskArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DiskArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Disk Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The Disk resource accepts the following input properties:
- Async
Primary DiskDisk Async Primary Disk Args A nested object resource
- Description string
An optional description of this resource. Provide this property when you create the resource.
- Disk
Encryption DiskKey Disk Encryption Key Args Encrypts the disk using a customer-supplied encryption key. After you encrypt a disk with a customer-supplied key, you must provide the same key if you use the disk later (e.g. to create a disk snapshot or an image, or to attach the disk to a virtual machine). Customer-supplied encryption keys do not protect access to metadata of the disk. If you do not provide an encryption key when creating the disk, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later. Structure is documented below.
- Image string
The image from which to initialize this disk. This can be one of: the image's
self_link
,projects/{project}/global/images/{image}
,projects/{project}/global/images/family/{family}
,global/images/{image}
,global/images/family/{family}
,family/{family}
,{project}/{family}
,{project}/{image}
,{family}
, or{image}
. If referred by family, the images names must include the family name. If they don't, use the gcp.compute.Image data source. For instance, the imagecentos-6-v20180104
includes its family namecentos-6
. These images can be referred by family name here.- Interface string
Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI.
This field is no longer in use, disk interfaces will be automatically determined on attachment. To resolve this issue, remove this field from your config.
- Labels Dictionary<string, string>
Labels to apply to this disk. A list of key->value pairs.
- Multi
Writer bool Indicates whether or not the disk can be read/write attached to more than one instance.
- Name string
Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression
a-z?
which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.- Physical
Block intSize Bytes Physical block size of the persistent disk, in bytes. If not present in a request, a default value is used. Currently supported sizes are 4096 and 16384, other sizes may be added in the future. If an unsupported value is requested, the error message will list the supported values for the caller's project.
- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Provisioned
Iops int Indicates how many IOPS must be provisioned for the disk.
- Resource
Policies 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
orsnapshot
parameter, or specify it alone to create an empty persistent disk. If you specify this field along withimage
orsnapshot
, 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 addlifecycle.prevent_destroy
in the config to prevent destroying and recreating.- Snapshot string
The source snapshot used to create this disk. You can provide this as a partial or full URL to the resource. If the snapshot is in another project than this disk, you must supply a full URL. For example, the following are valid values:
- 'https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot' * 'projects/project/global/snapshots/snapshot' * 'global/snapshots/snapshot' * 'snapshot'
- Source
Disk 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}
- Source
Image DiskEncryption Key Source Image Encryption Key Args The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key. Structure is documented below.
- Source
Snapshot DiskEncryption Key Source Snapshot Encryption Key Args The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. Structure is documented below.
- Type string
URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk.
- Zone string
A reference to the zone where the disk resides.
- Async
Primary DiskDisk Async Primary Disk Args A nested object resource
- Description string
An optional description of this resource. Provide this property when you create the resource.
- Disk
Encryption DiskKey Disk Encryption Key Args Encrypts the disk using a customer-supplied encryption key. After you encrypt a disk with a customer-supplied key, you must provide the same key if you use the disk later (e.g. to create a disk snapshot or an image, or to attach the disk to a virtual machine). Customer-supplied encryption keys do not protect access to metadata of the disk. If you do not provide an encryption key when creating the disk, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later. Structure is documented below.
- Image string
The image from which to initialize this disk. This can be one of: the image's
self_link
,projects/{project}/global/images/{image}
,projects/{project}/global/images/family/{family}
,global/images/{image}
,global/images/family/{family}
,family/{family}
,{project}/{family}
,{project}/{image}
,{family}
, or{image}
. If referred by family, the images names must include the family name. If they don't, use the gcp.compute.Image data source. For instance, the imagecentos-6-v20180104
includes its family namecentos-6
. These images can be referred by family name here.- Interface string
Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI.
This field is no longer in use, disk interfaces will be automatically determined on attachment. To resolve this issue, remove this field from your config.
- Labels map[string]string
Labels to apply to this disk. A list of key->value pairs.
- Multi
Writer bool Indicates whether or not the disk can be read/write attached to more than one instance.
- Name string
Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression
a-z?
which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.- Physical
Block intSize Bytes Physical block size of the persistent disk, in bytes. If not present in a request, a default value is used. Currently supported sizes are 4096 and 16384, other sizes may be added in the future. If an unsupported value is requested, the error message will list the supported values for the caller's project.
- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Provisioned
Iops int Indicates how many IOPS must be provisioned for the disk.
- Resource
Policies []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
orsnapshot
parameter, or specify it alone to create an empty persistent disk. If you specify this field along withimage
orsnapshot
, 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 addlifecycle.prevent_destroy
in the config to prevent destroying and recreating.- Snapshot string
The source snapshot used to create this disk. You can provide this as a partial or full URL to the resource. If the snapshot is in another project than this disk, you must supply a full URL. For example, the following are valid values:
- 'https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot' * 'projects/project/global/snapshots/snapshot' * 'global/snapshots/snapshot' * 'snapshot'
- Source
Disk 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}
- Source
Image DiskEncryption Key Source Image Encryption Key Args The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key. Structure is documented below.
- Source
Snapshot DiskEncryption Key Source Snapshot Encryption Key Args The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. Structure is documented below.
- Type string
URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk.
- Zone string
A reference to the zone where the disk resides.
- async
Primary DiskDisk Async Primary Disk Args A nested object resource
- description String
An optional description of this resource. Provide this property when you create the resource.
- disk
Encryption DiskKey Disk Encryption Key Args Encrypts the disk using a customer-supplied encryption key. After you encrypt a disk with a customer-supplied key, you must provide the same key if you use the disk later (e.g. to create a disk snapshot or an image, or to attach the disk to a virtual machine). Customer-supplied encryption keys do not protect access to metadata of the disk. If you do not provide an encryption key when creating the disk, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later. Structure is documented below.
- image String
The image from which to initialize this disk. This can be one of: the image's
self_link
,projects/{project}/global/images/{image}
,projects/{project}/global/images/family/{family}
,global/images/{image}
,global/images/family/{family}
,family/{family}
,{project}/{family}
,{project}/{image}
,{family}
, or{image}
. If referred by family, the images names must include the family name. If they don't, use the gcp.compute.Image data source. For instance, the imagecentos-6-v20180104
includes its family namecentos-6
. These images can be referred by family name here.- interface_ String
Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI.
This field is no longer in use, disk interfaces will be automatically determined on attachment. To resolve this issue, remove this field from your config.
- labels Map<String,String>
Labels to apply to this disk. A list of key->value pairs.
- multi
Writer Boolean Indicates whether or not the disk can be read/write attached to more than one instance.
- name String
Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression
a-z?
which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.- physical
Block IntegerSize Bytes Physical block size of the persistent disk, in bytes. If not present in a request, a default value is used. Currently supported sizes are 4096 and 16384, other sizes may be added in the future. If an unsupported value is requested, the error message will list the supported values for the caller's project.
- project String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- provisioned
Iops Integer Indicates how many IOPS must be provisioned for the disk.
- resource
Policies 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
orsnapshot
parameter, or specify it alone to create an empty persistent disk. If you specify this field along withimage
orsnapshot
, 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 addlifecycle.prevent_destroy
in the config to prevent destroying and recreating.- snapshot String
The source snapshot used to create this disk. You can provide this as a partial or full URL to the resource. If the snapshot is in another project than this disk, you must supply a full URL. For example, the following are valid values:
- 'https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot' * 'projects/project/global/snapshots/snapshot' * 'global/snapshots/snapshot' * 'snapshot'
- source
Disk 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}
- source
Image DiskEncryption Key Source Image Encryption Key Args The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key. Structure is documented below.
- source
Snapshot DiskEncryption Key Source Snapshot Encryption Key Args The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. Structure is documented below.
- type String
URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk.
- zone String
A reference to the zone where the disk resides.
- async
Primary DiskDisk Async Primary Disk Args A nested object resource
- description string
An optional description of this resource. Provide this property when you create the resource.
- disk
Encryption DiskKey Disk Encryption Key Args Encrypts the disk using a customer-supplied encryption key. After you encrypt a disk with a customer-supplied key, you must provide the same key if you use the disk later (e.g. to create a disk snapshot or an image, or to attach the disk to a virtual machine). Customer-supplied encryption keys do not protect access to metadata of the disk. If you do not provide an encryption key when creating the disk, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later. Structure is documented below.
- image string
The image from which to initialize this disk. This can be one of: the image's
self_link
,projects/{project}/global/images/{image}
,projects/{project}/global/images/family/{family}
,global/images/{image}
,global/images/family/{family}
,family/{family}
,{project}/{family}
,{project}/{image}
,{family}
, or{image}
. If referred by family, the images names must include the family name. If they don't, use the gcp.compute.Image data source. For instance, the imagecentos-6-v20180104
includes its family namecentos-6
. These images can be referred by family name here.- interface string
Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI.
This field is no longer in use, disk interfaces will be automatically determined on attachment. To resolve this issue, remove this field from your config.
- labels {[key: string]: string}
Labels to apply to this disk. A list of key->value pairs.
- multi
Writer boolean Indicates whether or not the disk can be read/write attached to more than one instance.
- name string
Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression
a-z?
which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.- physical
Block numberSize Bytes Physical block size of the persistent disk, in bytes. If not present in a request, a default value is used. Currently supported sizes are 4096 and 16384, other sizes may be added in the future. If an unsupported value is requested, the error message will list the supported values for the caller's project.
- project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- provisioned
Iops number Indicates how many IOPS must be provisioned for the disk.
- resource
Policies 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
orsnapshot
parameter, or specify it alone to create an empty persistent disk. If you specify this field along withimage
orsnapshot
, 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 addlifecycle.prevent_destroy
in the config to prevent destroying and recreating.- snapshot string
The source snapshot used to create this disk. You can provide this as a partial or full URL to the resource. If the snapshot is in another project than this disk, you must supply a full URL. For example, the following are valid values:
- 'https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot' * 'projects/project/global/snapshots/snapshot' * 'global/snapshots/snapshot' * 'snapshot'
- source
Disk 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}
- source
Image DiskEncryption Key Source Image Encryption Key Args The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key. Structure is documented below.
- source
Snapshot DiskEncryption Key Source Snapshot Encryption Key Args The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. Structure is documented below.
- type string
URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk.
- zone string
A reference to the zone where the disk resides.
- async_
primary_ Diskdisk Async Primary Disk Args A nested object resource
- description str
An optional description of this resource. Provide this property when you create the resource.
- disk_
encryption_ Diskkey Disk Encryption Key Args Encrypts the disk using a customer-supplied encryption key. After you encrypt a disk with a customer-supplied key, you must provide the same key if you use the disk later (e.g. to create a disk snapshot or an image, or to attach the disk to a virtual machine). Customer-supplied encryption keys do not protect access to metadata of the disk. If you do not provide an encryption key when creating the disk, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later. Structure is documented below.
- image str
The image from which to initialize this disk. This can be one of: the image's
self_link
,projects/{project}/global/images/{image}
,projects/{project}/global/images/family/{family}
,global/images/{image}
,global/images/family/{family}
,family/{family}
,{project}/{family}
,{project}/{image}
,{family}
, or{image}
. If referred by family, the images names must include the family name. If they don't, use the gcp.compute.Image data source. For instance, the imagecentos-6-v20180104
includes its family namecentos-6
. These images can be referred by family name here.- interface str
Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI.
This field is no longer in use, disk interfaces will be automatically determined on attachment. To resolve this issue, remove this field from your config.
- labels Mapping[str, str]
Labels to apply to this disk. A list of key->value pairs.
- multi_
writer bool Indicates whether or not the disk can be read/write attached to more than one instance.
- name str
Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression
a-z?
which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.- physical_
block_ intsize_ bytes Physical block size of the persistent disk, in bytes. If not present in a request, a default value is used. Currently supported sizes are 4096 and 16384, other sizes may be added in the future. If an unsupported value is requested, the error message will list the supported values for the caller's project.
- project str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- provisioned_
iops int Indicates how many IOPS must be provisioned for the disk.
- resource_
policies Sequence[str] Resource policies applied to this disk for automatic snapshot creations. ~>NOTE This value does not support updating the resource policy, as resource policies can not be updated more than one at a time. Use
gcp.compute.DiskResourcePolicyAttachment
to allow for updating the resource policy attached to the disk.- size int
Size of the persistent disk, specified in GB. You can specify this field when creating a persistent disk using the
image
orsnapshot
parameter, or specify it alone to create an empty persistent disk. If you specify this field along withimage
orsnapshot
, 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 addlifecycle.prevent_destroy
in the config to prevent destroying and recreating.- snapshot str
The source snapshot used to create this disk. You can provide this as a partial or full URL to the resource. If the snapshot is in another project than this disk, you must supply a full URL. For example, the following are valid values:
- 'https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot' * 'projects/project/global/snapshots/snapshot' * 'global/snapshots/snapshot' * 'snapshot'
- source_
disk str The source disk used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values:
- https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/disks/{disk}
- https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/disks/{disk}
- projects/{project}/zones/{zone}/disks/{disk}
- projects/{project}/regions/{region}/disks/{disk}
- zones/{zone}/disks/{disk}
- regions/{region}/disks/{disk}
- source_
image_ Diskencryption_ key Source Image Encryption Key Args The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key. Structure is documented below.
- source_
snapshot_ Diskencryption_ key Source Snapshot Encryption Key Args The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. Structure is documented below.
- type str
URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk.
- zone str
A reference to the zone where the disk resides.
- async
Primary Property MapDisk A nested object resource
- description String
An optional description of this resource. Provide this property when you create the resource.
- disk
Encryption Property MapKey Encrypts the disk using a customer-supplied encryption key. After you encrypt a disk with a customer-supplied key, you must provide the same key if you use the disk later (e.g. to create a disk snapshot or an image, or to attach the disk to a virtual machine). Customer-supplied encryption keys do not protect access to metadata of the disk. If you do not provide an encryption key when creating the disk, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later. Structure is documented below.
- image String
The image from which to initialize this disk. This can be one of: the image's
self_link
,projects/{project}/global/images/{image}
,projects/{project}/global/images/family/{family}
,global/images/{image}
,global/images/family/{family}
,family/{family}
,{project}/{family}
,{project}/{image}
,{family}
, or{image}
. If referred by family, the images names must include the family name. If they don't, use the gcp.compute.Image data source. For instance, the imagecentos-6-v20180104
includes its family namecentos-6
. These images can be referred by family name here.- interface String
Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI.
This field is no longer in use, disk interfaces will be automatically determined on attachment. To resolve this issue, remove this field from your config.
- labels Map<String>
Labels to apply to this disk. A list of key->value pairs.
- multi
Writer Boolean Indicates whether or not the disk can be read/write attached to more than one instance.
- name String
Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression
a-z?
which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.- physical
Block NumberSize Bytes Physical block size of the persistent disk, in bytes. If not present in a request, a default value is used. Currently supported sizes are 4096 and 16384, other sizes may be added in the future. If an unsupported value is requested, the error message will list the supported values for the caller's project.
- project String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- provisioned
Iops Number Indicates how many IOPS must be provisioned for the disk.
- resource
Policies 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
orsnapshot
parameter, or specify it alone to create an empty persistent disk. If you specify this field along withimage
orsnapshot
, 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 addlifecycle.prevent_destroy
in the config to prevent destroying and recreating.- snapshot String
The source snapshot used to create this disk. You can provide this as a partial or full URL to the resource. If the snapshot is in another project than this disk, you must supply a full URL. For example, the following are valid values:
- 'https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot' * 'projects/project/global/snapshots/snapshot' * 'global/snapshots/snapshot' * 'snapshot'
- source
Disk 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}
- source
Image Property MapEncryption Key The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key. Structure is documented below.
- source
Snapshot Property MapEncryption Key The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. Structure is documented below.
- type String
URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk.
- zone String
A reference to the zone where the disk resides.
Outputs
All input properties are implicitly available as output properties. Additionally, the Disk resource produces the following output properties:
- Creation
Timestamp string Creation timestamp in RFC3339 text format.
- Id string
The provider-assigned unique ID for this managed resource.
- Label
Fingerprint string The fingerprint used for optimistic locking of this resource. Used internally during updates.
- Last
Attach stringTimestamp Last attach timestamp in RFC3339 text format.
- Last
Detach stringTimestamp Last detach timestamp in RFC3339 text format.
- Self
Link string The URI of the created resource.
- Source
Disk stringId 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 stringId The ID value of the image used to create this disk. This value identifies the exact image that was used to create this persistent disk. For example, if you created the persistent disk from an image that was later deleted and recreated under the same name, the source image ID would identify the exact version of the image that was used.
- Source
Snapshot stringId 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
- Creation
Timestamp string Creation timestamp in RFC3339 text format.
- Id string
The provider-assigned unique ID for this managed resource.
- Label
Fingerprint string The fingerprint used for optimistic locking of this resource. Used internally during updates.
- Last
Attach stringTimestamp Last attach timestamp in RFC3339 text format.
- Last
Detach stringTimestamp Last detach timestamp in RFC3339 text format.
- Self
Link string The URI of the created resource.
- Source
Disk stringId 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 stringId The ID value of the image used to create this disk. This value identifies the exact image that was used to create this persistent disk. For example, if you created the persistent disk from an image that was later deleted and recreated under the same name, the source image ID would identify the exact version of the image that was used.
- Source
Snapshot stringId 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 String Creation timestamp in RFC3339 text format.
- id String
The provider-assigned unique ID for this managed resource.
- label
Fingerprint String The fingerprint used for optimistic locking of this resource. Used internally during updates.
- last
Attach StringTimestamp Last attach timestamp in RFC3339 text format.
- last
Detach StringTimestamp Last detach timestamp in RFC3339 text format.
- self
Link String The URI of the created resource.
- source
Disk StringId 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 StringId The ID value of the image used to create this disk. This value identifies the exact image that was used to create this persistent disk. For example, if you created the persistent disk from an image that was later deleted and recreated under the same name, the source image ID would identify the exact version of the image that was used.
- source
Snapshot StringId 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
- creation
Timestamp string Creation timestamp in RFC3339 text format.
- id string
The provider-assigned unique ID for this managed resource.
- label
Fingerprint string The fingerprint used for optimistic locking of this resource. Used internally during updates.
- last
Attach stringTimestamp Last attach timestamp in RFC3339 text format.
- last
Detach stringTimestamp Last detach timestamp in RFC3339 text format.
- self
Link string The URI of the created resource.
- source
Disk stringId 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 stringId The ID value of the image used to create this disk. This value identifies the exact image that was used to create this persistent disk. For example, if you created the persistent disk from an image that was later deleted and recreated under the same name, the source image ID would identify the exact version of the image that was used.
- source
Snapshot stringId The unique ID of the snapshot used to create this disk. This value identifies the exact snapshot that was used to create this persistent disk. For example, if you created the persistent disk from a snapshot that was later deleted and recreated under the same name, the source snapshot ID would identify the exact version of the snapshot that was used.
- users string[]
Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance
- creation_
timestamp str Creation timestamp in RFC3339 text format.
- id str
The provider-assigned unique ID for this managed resource.
- label_
fingerprint str The fingerprint used for optimistic locking of this resource. Used internally during updates.
- last_
attach_ strtimestamp Last attach timestamp in RFC3339 text format.
- last_
detach_ strtimestamp Last detach timestamp in RFC3339 text format.
- self_
link str The URI of the created resource.
- source_
disk_ strid 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_ strid The ID value of the image used to create this disk. This value identifies the exact image that was used to create this persistent disk. For example, if you created the persistent disk from an image that was later deleted and recreated under the same name, the source image ID would identify the exact version of the image that was used.
- source_
snapshot_ strid 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
- creation
Timestamp String Creation timestamp in RFC3339 text format.
- id String
The provider-assigned unique ID for this managed resource.
- label
Fingerprint String The fingerprint used for optimistic locking of this resource. Used internally during updates.
- last
Attach StringTimestamp Last attach timestamp in RFC3339 text format.
- last
Detach StringTimestamp Last detach timestamp in RFC3339 text format.
- self
Link String The URI of the created resource.
- source
Disk StringId 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 StringId The ID value of the image used to create this disk. This value identifies the exact image that was used to create this persistent disk. For example, if you created the persistent disk from an image that was later deleted and recreated under the same name, the source image ID would identify the exact version of the image that was used.
- source
Snapshot StringId The unique ID of the snapshot used to create this disk. This value identifies the exact snapshot that was used to create this persistent disk. For example, if you created the persistent disk from a snapshot that was later deleted and recreated under the same name, the source snapshot ID would identify the exact version of the snapshot that was used.
- users List<String>
Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance
Look up Existing Disk Resource
Get an existing Disk resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: DiskState, opts?: CustomResourceOptions): Disk
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
async_primary_disk: Optional[DiskAsyncPrimaryDiskArgs] = None,
creation_timestamp: Optional[str] = None,
description: Optional[str] = None,
disk_encryption_key: Optional[DiskDiskEncryptionKeyArgs] = None,
image: Optional[str] = None,
interface: Optional[str] = None,
label_fingerprint: Optional[str] = None,
labels: Optional[Mapping[str, str]] = None,
last_attach_timestamp: Optional[str] = None,
last_detach_timestamp: Optional[str] = None,
multi_writer: Optional[bool] = None,
name: Optional[str] = None,
physical_block_size_bytes: Optional[int] = None,
project: Optional[str] = None,
provisioned_iops: Optional[int] = None,
resource_policies: Optional[Sequence[str]] = None,
self_link: Optional[str] = None,
size: Optional[int] = None,
snapshot: Optional[str] = None,
source_disk: Optional[str] = None,
source_disk_id: Optional[str] = None,
source_image_encryption_key: Optional[DiskSourceImageEncryptionKeyArgs] = None,
source_image_id: Optional[str] = None,
source_snapshot_encryption_key: Optional[DiskSourceSnapshotEncryptionKeyArgs] = None,
source_snapshot_id: Optional[str] = None,
type: Optional[str] = None,
users: Optional[Sequence[str]] = None,
zone: Optional[str] = None) -> Disk
func GetDisk(ctx *Context, name string, id IDInput, state *DiskState, opts ...ResourceOption) (*Disk, error)
public static Disk Get(string name, Input<string> id, DiskState? state, CustomResourceOptions? opts = null)
public static Disk get(String name, Output<String> id, DiskState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Async
Primary DiskDisk Async Primary Disk Args A nested object resource
- Creation
Timestamp string Creation timestamp in RFC3339 text format.
- Description string
An optional description of this resource. Provide this property when you create the resource.
- Disk
Encryption DiskKey Disk Encryption Key Args Encrypts the disk using a customer-supplied encryption key. After you encrypt a disk with a customer-supplied key, you must provide the same key if you use the disk later (e.g. to create a disk snapshot or an image, or to attach the disk to a virtual machine). Customer-supplied encryption keys do not protect access to metadata of the disk. If you do not provide an encryption key when creating the disk, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later. Structure is documented below.
- Image string
The image from which to initialize this disk. This can be one of: the image's
self_link
,projects/{project}/global/images/{image}
,projects/{project}/global/images/family/{family}
,global/images/{image}
,global/images/family/{family}
,family/{family}
,{project}/{family}
,{project}/{image}
,{family}
, or{image}
. If referred by family, the images names must include the family name. If they don't, use the gcp.compute.Image data source. For instance, the imagecentos-6-v20180104
includes its family namecentos-6
. These images can be referred by family name here.- Interface string
Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI.
This field is no longer in use, disk interfaces will be automatically determined on attachment. To resolve this issue, remove this field from your config.
- Label
Fingerprint 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.
- Last
Attach stringTimestamp Last attach timestamp in RFC3339 text format.
- Last
Detach stringTimestamp Last detach timestamp in RFC3339 text format.
- Multi
Writer bool Indicates whether or not the disk can be read/write attached to more than one instance.
- Name 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.- Physical
Block intSize Bytes Physical block size of the persistent disk, in bytes. If not present in a request, a default value is used. Currently supported sizes are 4096 and 16384, other sizes may be added in the future. If an unsupported value is requested, the error message will list the supported values for the caller's project.
- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Provisioned
Iops int Indicates how many IOPS must be provisioned for the disk.
- Resource
Policies 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.- Self
Link 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
orsnapshot
parameter, or specify it alone to create an empty persistent disk. If you specify this field along withimage
orsnapshot
, 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 addlifecycle.prevent_destroy
in the config to prevent destroying and recreating.- Snapshot string
The source snapshot used to create this disk. You can provide this as a partial or full URL to the resource. If the snapshot is in another project than this disk, you must supply a full URL. For example, the following are valid values:
- 'https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot' * 'projects/project/global/snapshots/snapshot' * 'global/snapshots/snapshot' * 'snapshot'
- Source
Disk 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}
- Source
Disk stringId 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 DiskEncryption Key Source Image Encryption Key Args 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 stringId The ID value of the image used to create this disk. This value identifies the exact image that was used to create this persistent disk. For example, if you created the persistent disk from an image that was later deleted and recreated under the same name, the source image ID would identify the exact version of the image that was used.
- Source
Snapshot DiskEncryption Key Source Snapshot Encryption Key Args 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 stringId The unique ID of the snapshot used to create this disk. This value identifies the exact snapshot that was used to create this persistent disk. For example, if you created the persistent disk from a snapshot that was later deleted and recreated under the same name, the source snapshot ID would identify the exact version of the snapshot that was used.
- Type string
URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk.
- Users List<string>
Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance
- Zone string
A reference to the zone where the disk resides.
- Async
Primary DiskDisk Async Primary Disk Args A nested object resource
- Creation
Timestamp string Creation timestamp in RFC3339 text format.
- Description string
An optional description of this resource. Provide this property when you create the resource.
- Disk
Encryption DiskKey Disk Encryption Key Args Encrypts the disk using a customer-supplied encryption key. After you encrypt a disk with a customer-supplied key, you must provide the same key if you use the disk later (e.g. to create a disk snapshot or an image, or to attach the disk to a virtual machine). Customer-supplied encryption keys do not protect access to metadata of the disk. If you do not provide an encryption key when creating the disk, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later. Structure is documented below.
- Image string
The image from which to initialize this disk. This can be one of: the image's
self_link
,projects/{project}/global/images/{image}
,projects/{project}/global/images/family/{family}
,global/images/{image}
,global/images/family/{family}
,family/{family}
,{project}/{family}
,{project}/{image}
,{family}
, or{image}
. If referred by family, the images names must include the family name. If they don't, use the gcp.compute.Image data source. For instance, the imagecentos-6-v20180104
includes its family namecentos-6
. These images can be referred by family name here.- Interface string
Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI.
This field is no longer in use, disk interfaces will be automatically determined on attachment. To resolve this issue, remove this field from your config.
- Label
Fingerprint 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.
- Last
Attach stringTimestamp Last attach timestamp in RFC3339 text format.
- Last
Detach stringTimestamp Last detach timestamp in RFC3339 text format.
- Multi
Writer bool Indicates whether or not the disk can be read/write attached to more than one instance.
- Name 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.- Physical
Block intSize Bytes Physical block size of the persistent disk, in bytes. If not present in a request, a default value is used. Currently supported sizes are 4096 and 16384, other sizes may be added in the future. If an unsupported value is requested, the error message will list the supported values for the caller's project.
- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Provisioned
Iops int Indicates how many IOPS must be provisioned for the disk.
- Resource
Policies []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.- Self
Link 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
orsnapshot
parameter, or specify it alone to create an empty persistent disk. If you specify this field along withimage
orsnapshot
, 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 addlifecycle.prevent_destroy
in the config to prevent destroying and recreating.- Snapshot string
The source snapshot used to create this disk. You can provide this as a partial or full URL to the resource. If the snapshot is in another project than this disk, you must supply a full URL. For example, the following are valid values:
- 'https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot' * 'projects/project/global/snapshots/snapshot' * 'global/snapshots/snapshot' * 'snapshot'
- Source
Disk 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}
- Source
Disk stringId 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 DiskEncryption Key Source Image Encryption Key Args 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 stringId The ID value of the image used to create this disk. This value identifies the exact image that was used to create this persistent disk. For example, if you created the persistent disk from an image that was later deleted and recreated under the same name, the source image ID would identify the exact version of the image that was used.
- Source
Snapshot DiskEncryption Key Source Snapshot Encryption Key Args 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 stringId The unique ID of the snapshot used to create this disk. This value identifies the exact snapshot that was used to create this persistent disk. For example, if you created the persistent disk from a snapshot that was later deleted and recreated under the same name, the source snapshot ID would identify the exact version of the snapshot that was used.
- Type string
URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk.
- Users []string
Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance
- Zone string
A reference to the zone where the disk resides.
- async
Primary DiskDisk Async Primary Disk Args A nested object resource
- creation
Timestamp String Creation timestamp in RFC3339 text format.
- description String
An optional description of this resource. Provide this property when you create the resource.
- disk
Encryption DiskKey Disk Encryption Key Args Encrypts the disk using a customer-supplied encryption key. After you encrypt a disk with a customer-supplied key, you must provide the same key if you use the disk later (e.g. to create a disk snapshot or an image, or to attach the disk to a virtual machine). Customer-supplied encryption keys do not protect access to metadata of the disk. If you do not provide an encryption key when creating the disk, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later. Structure is documented below.
- image String
The image from which to initialize this disk. This can be one of: the image's
self_link
,projects/{project}/global/images/{image}
,projects/{project}/global/images/family/{family}
,global/images/{image}
,global/images/family/{family}
,family/{family}
,{project}/{family}
,{project}/{image}
,{family}
, or{image}
. If referred by family, the images names must include the family name. If they don't, use the gcp.compute.Image data source. For instance, the imagecentos-6-v20180104
includes its family namecentos-6
. These images can be referred by family name here.- interface_ String
Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI.
This field is no longer in use, disk interfaces will be automatically determined on attachment. To resolve this issue, remove this field from your config.
- label
Fingerprint 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.
- last
Attach StringTimestamp Last attach timestamp in RFC3339 text format.
- last
Detach StringTimestamp Last detach timestamp in RFC3339 text format.
- multi
Writer Boolean Indicates whether or not the disk can be read/write attached to more than one instance.
- name String
Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression
a-z?
which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.- physical
Block IntegerSize Bytes Physical block size of the persistent disk, in bytes. If not present in a request, a default value is used. Currently supported sizes are 4096 and 16384, other sizes may be added in the future. If an unsupported value is requested, the error message will list the supported values for the caller's project.
- project String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- provisioned
Iops Integer Indicates how many IOPS must be provisioned for the disk.
- resource
Policies 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.- self
Link 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
orsnapshot
parameter, or specify it alone to create an empty persistent disk. If you specify this field along withimage
orsnapshot
, 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 addlifecycle.prevent_destroy
in the config to prevent destroying and recreating.- snapshot String
The source snapshot used to create this disk. You can provide this as a partial or full URL to the resource. If the snapshot is in another project than this disk, you must supply a full URL. For example, the following are valid values:
- 'https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot' * 'projects/project/global/snapshots/snapshot' * 'global/snapshots/snapshot' * 'snapshot'
- source
Disk 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}
- source
Disk StringId 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 DiskEncryption Key Source Image Encryption Key Args 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 StringId The ID value of the image used to create this disk. This value identifies the exact image that was used to create this persistent disk. For example, if you created the persistent disk from an image that was later deleted and recreated under the same name, the source image ID would identify the exact version of the image that was used.
- source
Snapshot DiskEncryption Key Source Snapshot Encryption Key Args 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 StringId The unique ID of the snapshot used to create this disk. This value identifies the exact snapshot that was used to create this persistent disk. For example, if you created the persistent disk from a snapshot that was later deleted and recreated under the same name, the source snapshot ID would identify the exact version of the snapshot that was used.
- type String
URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk.
- users List<String>
Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance
- zone String
A reference to the zone where the disk resides.
- async
Primary DiskDisk Async Primary Disk Args A nested object resource
- creation
Timestamp string Creation timestamp in RFC3339 text format.
- description string
An optional description of this resource. Provide this property when you create the resource.
- disk
Encryption DiskKey Disk Encryption Key Args Encrypts the disk using a customer-supplied encryption key. After you encrypt a disk with a customer-supplied key, you must provide the same key if you use the disk later (e.g. to create a disk snapshot or an image, or to attach the disk to a virtual machine). Customer-supplied encryption keys do not protect access to metadata of the disk. If you do not provide an encryption key when creating the disk, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later. Structure is documented below.
- image string
The image from which to initialize this disk. This can be one of: the image's
self_link
,projects/{project}/global/images/{image}
,projects/{project}/global/images/family/{family}
,global/images/{image}
,global/images/family/{family}
,family/{family}
,{project}/{family}
,{project}/{image}
,{family}
, or{image}
. If referred by family, the images names must include the family name. If they don't, use the gcp.compute.Image data source. For instance, the imagecentos-6-v20180104
includes its family namecentos-6
. These images can be referred by family name here.- interface string
Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI.
This field is no longer in use, disk interfaces will be automatically determined on attachment. To resolve this issue, remove this field from your config.
- label
Fingerprint 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.
- last
Attach stringTimestamp Last attach timestamp in RFC3339 text format.
- last
Detach stringTimestamp Last detach timestamp in RFC3339 text format.
- multi
Writer boolean Indicates whether or not the disk can be read/write attached to more than one instance.
- name string
Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression
a-z?
which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.- physical
Block numberSize Bytes Physical block size of the persistent disk, in bytes. If not present in a request, a default value is used. Currently supported sizes are 4096 and 16384, other sizes may be added in the future. If an unsupported value is requested, the error message will list the supported values for the caller's project.
- project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- provisioned
Iops number Indicates how many IOPS must be provisioned for the disk.
- resource
Policies 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.- self
Link 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
orsnapshot
parameter, or specify it alone to create an empty persistent disk. If you specify this field along withimage
orsnapshot
, 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 addlifecycle.prevent_destroy
in the config to prevent destroying and recreating.- snapshot string
The source snapshot used to create this disk. You can provide this as a partial or full URL to the resource. If the snapshot is in another project than this disk, you must supply a full URL. For example, the following are valid values:
- 'https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot' * 'projects/project/global/snapshots/snapshot' * 'global/snapshots/snapshot' * 'snapshot'
- source
Disk 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}
- source
Disk stringId 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 DiskEncryption Key Source Image Encryption Key Args 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 stringId The ID value of the image used to create this disk. This value identifies the exact image that was used to create this persistent disk. For example, if you created the persistent disk from an image that was later deleted and recreated under the same name, the source image ID would identify the exact version of the image that was used.
- source
Snapshot DiskEncryption Key Source Snapshot Encryption Key Args 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 stringId The unique ID of the snapshot used to create this disk. This value identifies the exact snapshot that was used to create this persistent disk. For example, if you created the persistent disk from a snapshot that was later deleted and recreated under the same name, the source snapshot ID would identify the exact version of the snapshot that was used.
- type string
URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk.
- users string[]
Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance
- zone string
A reference to the zone where the disk resides.
- async_
primary_ Diskdisk Async Primary Disk Args A nested object resource
- creation_
timestamp str Creation timestamp in RFC3339 text format.
- description str
An optional description of this resource. Provide this property when you create the resource.
- disk_
encryption_ Diskkey Disk Encryption Key Args Encrypts the disk using a customer-supplied encryption key. After you encrypt a disk with a customer-supplied key, you must provide the same key if you use the disk later (e.g. to create a disk snapshot or an image, or to attach the disk to a virtual machine). Customer-supplied encryption keys do not protect access to metadata of the disk. If you do not provide an encryption key when creating the disk, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later. Structure is documented below.
- image str
The image from which to initialize this disk. This can be one of: the image's
self_link
,projects/{project}/global/images/{image}
,projects/{project}/global/images/family/{family}
,global/images/{image}
,global/images/family/{family}
,family/{family}
,{project}/{family}
,{project}/{image}
,{family}
, or{image}
. If referred by family, the images names must include the family name. If they don't, use the gcp.compute.Image data source. For instance, the imagecentos-6-v20180104
includes its family namecentos-6
. These images can be referred by family name here.- interface str
Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI.
This field is no longer in use, disk interfaces will be automatically determined on attachment. To resolve this issue, remove this field from your config.
- label_
fingerprint str The fingerprint used for optimistic locking of this resource. Used internally during updates.
- labels Mapping[str, str]
Labels to apply to this disk. A list of key->value pairs.
- last_
attach_ strtimestamp Last attach timestamp in RFC3339 text format.
- last_
detach_ strtimestamp Last detach timestamp in RFC3339 text format.
- multi_
writer bool Indicates whether or not the disk can be read/write attached to more than one instance.
- name str
Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression
a-z?
which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.- physical_
block_ intsize_ bytes Physical block size of the persistent disk, in bytes. If not present in a request, a default value is used. Currently supported sizes are 4096 and 16384, other sizes may be added in the future. If an unsupported value is requested, the error message will list the supported values for the caller's project.
- project str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- provisioned_
iops int Indicates how many IOPS must be provisioned for the disk.
- resource_
policies Sequence[str] Resource policies applied to this disk for automatic snapshot creations. ~>NOTE This value does not support updating the resource policy, as resource policies can not be updated more than one at a time. Use
gcp.compute.DiskResourcePolicyAttachment
to allow for updating the resource policy attached to the disk.- self_
link str The URI of the created resource.
- size int
Size of the persistent disk, specified in GB. You can specify this field when creating a persistent disk using the
image
orsnapshot
parameter, or specify it alone to create an empty persistent disk. If you specify this field along withimage
orsnapshot
, 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 addlifecycle.prevent_destroy
in the config to prevent destroying and recreating.- snapshot str
The source snapshot used to create this disk. You can provide this as a partial or full URL to the resource. If the snapshot is in another project than this disk, you must supply a full URL. For example, the following are valid values:
- 'https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot' * 'projects/project/global/snapshots/snapshot' * 'global/snapshots/snapshot' * 'snapshot'
- source_
disk str The source disk used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values:
- https://www.googleapis.com/compute/v1/projects/{project}/zones/{zone}/disks/{disk}
- https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/disks/{disk}
- projects/{project}/zones/{zone}/disks/{disk}
- projects/{project}/regions/{region}/disks/{disk}
- zones/{zone}/disks/{disk}
- regions/{region}/disks/{disk}
- source_
disk_ strid 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_ Diskencryption_ key Source Image Encryption Key Args 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_ strid The ID value of the image used to create this disk. This value identifies the exact image that was used to create this persistent disk. For example, if you created the persistent disk from an image that was later deleted and recreated under the same name, the source image ID would identify the exact version of the image that was used.
- source_
snapshot_ Diskencryption_ key Source Snapshot Encryption Key Args 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_ strid The unique ID of the snapshot used to create this disk. This value identifies the exact snapshot that was used to create this persistent disk. For example, if you created the persistent disk from a snapshot that was later deleted and recreated under the same name, the source snapshot ID would identify the exact version of the snapshot that was used.
- type str
URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk.
- users Sequence[str]
Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance
- zone str
A reference to the zone where the disk resides.
- async
Primary Property MapDisk A nested object resource
- creation
Timestamp String Creation timestamp in RFC3339 text format.
- description String
An optional description of this resource. Provide this property when you create the resource.
- disk
Encryption Property MapKey Encrypts the disk using a customer-supplied encryption key. After you encrypt a disk with a customer-supplied key, you must provide the same key if you use the disk later (e.g. to create a disk snapshot or an image, or to attach the disk to a virtual machine). Customer-supplied encryption keys do not protect access to metadata of the disk. If you do not provide an encryption key when creating the disk, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later. Structure is documented below.
- image String
The image from which to initialize this disk. This can be one of: the image's
self_link
,projects/{project}/global/images/{image}
,projects/{project}/global/images/family/{family}
,global/images/{image}
,global/images/family/{family}
,family/{family}
,{project}/{family}
,{project}/{image}
,{family}
, or{image}
. If referred by family, the images names must include the family name. If they don't, use the gcp.compute.Image data source. For instance, the imagecentos-6-v20180104
includes its family namecentos-6
. These images can be referred by family name here.- interface String
Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI.
This field is no longer in use, disk interfaces will be automatically determined on attachment. To resolve this issue, remove this field from your config.
- label
Fingerprint 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.
- last
Attach StringTimestamp Last attach timestamp in RFC3339 text format.
- last
Detach StringTimestamp Last detach timestamp in RFC3339 text format.
- multi
Writer Boolean Indicates whether or not the disk can be read/write attached to more than one instance.
- name String
Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression
a-z?
which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.- physical
Block NumberSize Bytes Physical block size of the persistent disk, in bytes. If not present in a request, a default value is used. Currently supported sizes are 4096 and 16384, other sizes may be added in the future. If an unsupported value is requested, the error message will list the supported values for the caller's project.
- project String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- provisioned
Iops Number Indicates how many IOPS must be provisioned for the disk.
- resource
Policies 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.- self
Link 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
orsnapshot
parameter, or specify it alone to create an empty persistent disk. If you specify this field along withimage
orsnapshot
, 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 addlifecycle.prevent_destroy
in the config to prevent destroying and recreating.- snapshot String
The source snapshot used to create this disk. You can provide this as a partial or full URL to the resource. If the snapshot is in another project than this disk, you must supply a full URL. For example, the following are valid values:
- 'https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot' * 'projects/project/global/snapshots/snapshot' * 'global/snapshots/snapshot' * 'snapshot'
- source
Disk 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}
- source
Disk StringId 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 Property MapEncryption Key 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 StringId The ID value of the image used to create this disk. This value identifies the exact image that was used to create this persistent disk. For example, if you created the persistent disk from an image that was later deleted and recreated under the same name, the source image ID would identify the exact version of the image that was used.
- source
Snapshot Property MapEncryption Key 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 StringId The unique ID of the snapshot used to create this disk. This value identifies the exact snapshot that was used to create this persistent disk. For example, if you created the persistent disk from a snapshot that was later deleted and recreated under the same name, the source snapshot ID would identify the exact version of the snapshot that was used.
- type String
URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk.
- users List<String>
Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance
- zone String
A reference to the zone where the disk resides.
Supporting Types
DiskAsyncPrimaryDisk
- Disk string
Primary disk for asynchronous disk replication.
- Disk string
Primary disk for asynchronous disk replication.
- disk String
Primary disk for asynchronous disk replication.
- disk string
Primary disk for asynchronous disk replication.
- disk str
Primary disk for asynchronous disk replication.
- disk String
Primary disk for asynchronous disk replication.
DiskDiskEncryptionKey
- Kms
Key stringSelf Link 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 haveroles/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 stringService Account 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 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.
- Rsa
Encrypted stringKey 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 stringSelf Link 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 haveroles/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 stringService Account 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 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.
- Rsa
Encrypted stringKey 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 StringSelf Link 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 haveroles/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 StringService Account 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 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.
- rsa
Encrypted StringKey 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 stringSelf Link 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 haveroles/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 stringService Account 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 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.
- rsa
Encrypted stringKey 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_ strself_ link 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 haveroles/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_ strservice_ account The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used.
- raw_
key str Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. Note: This property is sensitive and will not be displayed in the plan.
- rsa_
encrypted_ strkey 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.
- kms
Key StringSelf Link 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 haveroles/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 StringService Account 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 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.
- rsa
Encrypted StringKey Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey. Note: This property is sensitive and will not be displayed in the plan.
- sha256 String
(Output) The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
DiskSourceImageEncryptionKey
- Kms
Key stringSelf Link 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 haveroles/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 stringService Account 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 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 stringSelf Link 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 haveroles/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 stringService Account 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 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 StringSelf Link 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 haveroles/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 StringService Account 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 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 stringSelf Link 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 haveroles/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 stringService Account 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 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_ strself_ link 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 haveroles/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_ strservice_ account The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used.
- raw_
key str Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
- sha256 str
(Output) The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
- kms
Key StringSelf Link 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 haveroles/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 StringService Account 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 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
- Kms
Key stringSelf Link 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 haveroles/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 stringService Account 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 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 stringSelf Link 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 haveroles/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 stringService Account 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 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 StringSelf Link 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 haveroles/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 StringService Account 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 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 stringSelf Link 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 haveroles/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 stringService Account 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 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_ strself_ link 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 haveroles/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_ strservice_ account The service account used for the encryption request for the given KMS key. If absent, the Compute Engine Service Agent service account is used.
- raw_
key str Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
- sha256 str
(Output) The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
- kms
Key StringSelf Link 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 haveroles/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 StringService Account 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 String Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
- sha256 String
(Output) The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
Import
Disk can be imported using any of these accepted formats
$ pulumi import gcp:compute/disk:Disk default projects/{{project}}/zones/{{zone}}/disks/{{name}}
$ pulumi import gcp:compute/disk:Disk default {{project}}/{{zone}}/{{name}}
$ pulumi import gcp:compute/disk:Disk default {{zone}}/{{name}}
$ pulumi import gcp:compute/disk:Disk default {{name}}
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
google-beta
Terraform Provider.