Disk
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
Warning: All arguments including
disk_encryption_key.raw_keywill be stored in the raw state as plain-text. Read more about secrets in state.
Create a Disk Resource
new Disk(name: string, args?: DiskArgs, opts?: CustomResourceOptions);def Disk(resource_name, opts=None, description=None, disk_encryption_key=None, image=None, labels=None, name=None, physical_block_size_bytes=None, project=None, resource_policies=None, size=None, snapshot=None, source_image_encryption_key=None, source_snapshot_encryption_key=None, type=None, zone=None, __props__=None);public Disk(string name, DiskArgs? args = null, CustomResourceOptions? opts = null)- 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.
- opts ResourceOptions
- A bag of options that control this 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.
Disk Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The Disk resource accepts the following input properties:
- 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-v20180104includes its family namecentos-6. These images can be referred by family name here.- Labels Dictionary<string, string>
Labels to apply to this disk. A list of key->value pairs.
- 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.
- 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 ‘google_compute_disk_resource_policy_attachment’ 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
imageorsnapshotparameter, or specify it alone to create an empty persistent disk. If you specify this field along withimageorsnapshot, the value must not be less than the size of the image or the size of the snapshot.- 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
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.
- Description string
An optional description of this resource. Provide this property when you create the resource.
- Disk
Encryption DiskKey Disk Encryption Key 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-v20180104includes its family namecentos-6. These images can be referred by family name here.- Labels map[string]string
Labels to apply to this disk. A list of key->value pairs.
- 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.
- 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 ‘google_compute_disk_resource_policy_attachment’ 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
imageorsnapshotparameter, or specify it alone to create an empty persistent disk. If you specify this field along withimageorsnapshot, the value must not be less than the size of the image or the size of the snapshot.- 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
Image DiskEncryption Key Source Image Encryption 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 DiskEncryption Key Source Snapshot Encryption 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.
- description string
An optional description of this resource. Provide this property when you create the resource.
- disk
Encryption DiskKey Disk Encryption Key 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-v20180104includes its family namecentos-6. These images can be referred by family name here.- labels {[key: string]: string}
Labels to apply to this disk. A list of key->value pairs.
- 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.
- 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 ‘google_compute_disk_resource_policy_attachment’ 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
imageorsnapshotparameter, or specify it alone to create an empty persistent disk. If you specify this field along withimageorsnapshot, the value must not be less than the size of the image or the size of the snapshot.- 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
Image DiskEncryption Key Source Image Encryption 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 DiskEncryption Key Source Snapshot Encryption 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.
- description str
An optional description of this resource. Provide this property when you create the resource.
- disk_
encryption_ Dict[Diskkey Disk Encryption Key] 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-v20180104includes its family namecentos-6. These images can be referred by family name here.- labels Dict[str, str]
Labels to apply to this disk. A list of key->value pairs.
- 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_ floatsize_ 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.
- resource_
policies List[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 ‘google_compute_disk_resource_policy_attachment’ to allow for updating the resource policy attached to the disk.
- size float
Size of the persistent disk, specified in GB. You can specify this field when creating a persistent disk using the
imageorsnapshotparameter, or specify it alone to create an empty persistent disk. If you specify this field along withimageorsnapshot, the value must not be less than the size of the image or the size of the snapshot.- 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_
image_ Dict[Diskencryption_ key Source Image Encryption 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_ Dict[Diskencryption_ key Source Snapshot Encryption 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 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.
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
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
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
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_
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 List[str]
Links to the users of the disk (attached instances) in form: project/zones/zone/instances/instance
Look up an 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): Diskstatic get(resource_name, id, opts=None, creation_timestamp=None, description=None, disk_encryption_key=None, image=None, label_fingerprint=None, labels=None, last_attach_timestamp=None, last_detach_timestamp=None, name=None, physical_block_size_bytes=None, project=None, resource_policies=None, self_link=None, size=None, snapshot=None, source_image_encryption_key=None, source_image_id=None, source_snapshot_encryption_key=None, source_snapshot_id=None, type=None, users=None, zone=None, __props__=None);public static Disk Get(string name, Input<string> id, DiskState? state, CustomResourceOptions? opts = null)- 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.
The following state arguments are supported:
- 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-v20180104includes its family namecentos-6. These images can be referred by family name here.- 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.
- 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.
- 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 ‘google_compute_disk_resource_policy_attachment’ 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
imageorsnapshotparameter, or specify it alone to create an empty persistent disk. If you specify this field along withimageorsnapshot, the value must not be less than the size of the image or the size of the snapshot.- 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
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.
- 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 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-v20180104includes its family namecentos-6. These images can be referred by family name here.- 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.
- 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.
- 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 ‘google_compute_disk_resource_policy_attachment’ 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
imageorsnapshotparameter, or specify it alone to create an empty persistent disk. If you specify this field along withimageorsnapshot, the value must not be less than the size of the image or the size of the snapshot.- 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
Image DiskEncryption Key Source Image Encryption 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 DiskEncryption Key Source Snapshot Encryption 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 []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.
- 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 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-v20180104includes its family namecentos-6. These images can be referred by family name here.- 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.
- 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.
- 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 ‘google_compute_disk_resource_policy_attachment’ 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
imageorsnapshotparameter, or specify it alone to create an empty persistent disk. If you specify this field along withimageorsnapshot, the value must not be less than the size of the image or the size of the snapshot.- 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
Image DiskEncryption Key Source Image Encryption 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 DiskEncryption Key Source Snapshot Encryption 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 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.
- 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_ Dict[Diskkey Disk Encryption Key] 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-v20180104includes its family namecentos-6. These images can be referred by family name here.- label_
fingerprint str The fingerprint used for optimistic locking of this resource. Used internally during updates.
- labels Dict[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.
- 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_ floatsize_ 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.
- resource_
policies List[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 ‘google_compute_disk_resource_policy_attachment’ to allow for updating the resource policy attached to the disk.
- self_
link str The URI of the created resource.
- size float
Size of the persistent disk, specified in GB. You can specify this field when creating a persistent disk using the
imageorsnapshotparameter, or specify it alone to create an empty persistent disk. If you specify this field along withimageorsnapshot, the value must not be less than the size of the image or the size of the snapshot.- 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_
image_ Dict[Diskencryption_ key Source Image Encryption 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_ 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_ Dict[Diskencryption_ key Source Snapshot Encryption 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_ 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 List[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.
Supporting Types
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.cryptoKeyEncrypterDecrypterto use this feature. See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys- 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
- 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.cryptoKeyEncrypterDecrypterto use this feature. See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys- 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
- 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.cryptoKeyEncrypterDecrypterto use this feature. See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys- 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
- 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.cryptoKeyEncrypterDecrypterto use this feature. See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys- 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
- 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.cryptoKeyEncrypterDecrypterto use this feature. See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys- 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
- 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.cryptoKeyEncrypterDecrypterto use this feature. See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys- 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
- 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.cryptoKeyEncrypterDecrypterto use this feature. See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys- 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
- 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.cryptoKeyEncrypterDecrypterto use this feature. See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys- 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
- 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.cryptoKeyEncrypterDecrypterto use this feature. See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys- 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
- 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.cryptoKeyEncrypterDecrypterto use this feature. See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys- 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
- 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.cryptoKeyEncrypterDecrypterto use this feature. See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys- 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
- 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.cryptoKeyEncrypterDecrypterto use this feature. See https://cloud.google.com/compute/docs/disks/customer-managed-encryption#encrypt_a_new_persistent_disk_with_your_own_keys- 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
- The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
Package Details
- Repository
- https://github.com/pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-betaTerraform Provider.