RegionDisk

class RegionDisk : KotlinCustomResource

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 RegionDisk, see:

Warning: All arguments including disk_encryption_key.raw_key will be stored in the raw state as plain-text.

Example Usage

Region Disk Basic

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.Snapshot;
import com.pulumi.gcp.compute.SnapshotArgs;
import com.pulumi.gcp.compute.RegionDisk;
import com.pulumi.gcp.compute.RegionDiskArgs;
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 disk = new Disk("disk", DiskArgs.builder()
.image("debian-cloud/debian-11")
.size(50)
.type("pd-ssd")
.zone("us-central1-a")
.build());
var snapdisk = new Snapshot("snapdisk", SnapshotArgs.builder()
.sourceDisk(disk.name())
.zone("us-central1-a")
.build());
var regiondisk = new RegionDisk("regiondisk", RegionDiskArgs.builder()
.snapshot(snapdisk.id())
.type("pd-ssd")
.region("us-central1")
.physicalBlockSizeBytes(4096)
.replicaZones(
"us-central1-a",
"us-central1-f")
.build());
}
}

Region Disk Async

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.RegionDisk;
import com.pulumi.gcp.compute.RegionDiskArgs;
import com.pulumi.gcp.compute.inputs.RegionDiskAsyncPrimaryDiskArgs;
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 RegionDisk("primary", RegionDiskArgs.builder()
.type("pd-ssd")
.region("us-central1")
.physicalBlockSizeBytes(4096)
.replicaZones(
"us-central1-a",
"us-central1-f")
.build());
var secondary = new RegionDisk("secondary", RegionDiskArgs.builder()
.type("pd-ssd")
.region("us-east1")
.physicalBlockSizeBytes(4096)
.asyncPrimaryDisk(RegionDiskAsyncPrimaryDiskArgs.builder()
.disk(primary.id())
.build())
.replicaZones(
"us-east1-b",
"us-east1-c")
.build());
}
}

Region Disk Features

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.RegionDisk;
import com.pulumi.gcp.compute.RegionDiskArgs;
import com.pulumi.gcp.compute.inputs.RegionDiskGuestOsFeatureArgs;
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 regiondisk = new RegionDisk("regiondisk", RegionDiskArgs.builder()
.guestOsFeatures(
RegionDiskGuestOsFeatureArgs.builder()
.type("SECURE_BOOT")
.build(),
RegionDiskGuestOsFeatureArgs.builder()
.type("MULTI_IP_SUBNET")
.build(),
RegionDiskGuestOsFeatureArgs.builder()
.type("WINDOWS")
.build())
.licenses("https://www.googleapis.com/compute/v1/projects/windows-cloud/global/licenses/windows-server-core")
.physicalBlockSizeBytes(4096)
.region("us-central1")
.replicaZones(
"us-central1-a",
"us-central1-f")
.type("pd-ssd")
.build());
}
}

Import

RegionDisk can be imported using any of these accepted formats

$ pulumi import gcp:compute/regionDisk:RegionDisk default projects/{{project}}/regions/{{region}}/disks/{{name}}
$ pulumi import gcp:compute/regionDisk:RegionDisk default {{project}}/{{region}}/{{name}}
$ pulumi import gcp:compute/regionDisk:RegionDisk default {{region}}/{{name}}
$ pulumi import gcp:compute/regionDisk:RegionDisk default {{name}}

Properties

Link copied to clipboard

A nested object resource Structure is documented below.

Link copied to clipboard

Creation timestamp in RFC3339 text format.

Link copied to clipboard
val description: Output<String>?

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

Link copied to clipboard

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.

Link copied to clipboard

A list of features to enable on the guest operating system. Applicable only for bootable disks. Structure is documented below.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val interface: Output<String>?

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

Link copied to clipboard

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

Link copied to clipboard
val labels: Output<Map<String, String>>?

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

Link copied to clipboard

Last attach timestamp in RFC3339 text format.

Link copied to clipboard

Last detach timestamp in RFC3339 text format.

Link copied to clipboard
val licenses: Output<List<String>>

Any applicable license URI.

Link copied to clipboard
val name: Output<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.

Link copied to clipboard

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.

Link copied to clipboard
val project: Output<String>

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

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val region: Output<String>

A reference to the region where the disk resides.

Link copied to clipboard
val replicaZones: Output<List<String>>

URLs of the zones where the disk should be replicated to.

Link copied to clipboard
val selfLink: Output<String>

The URI of the created resource.

Link copied to clipboard
val size: Output<Int>

Size of the persistent disk, specified in GB. You can specify this field when creating a persistent disk using the sourceImage or sourceSnapshot parameter, or specify it alone to create an empty persistent disk. If you specify this field along with sourceImage or sourceSnapshot, the value of sizeGb must not be less than the size of the sourceImage or the size of the snapshot.

Link copied to clipboard
val snapshot: Output<String>?

The source snapshot used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values: * 'https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot' * 'projects/project/global/snapshots/snapshot' * 'global/snapshots/snapshot' * 'snapshot'

Link copied to clipboard
val sourceDisk: Output<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:

Link copied to clipboard
val sourceDiskId: Output<String>

The ID value of the disk used to create this image. This value may be used to determine whether the image was taken from the current or a previous instance of a given disk name.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard
val type: Output<String>?

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

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val users: Output<List<String>>

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