RegionDiskArgs

data class RegionDiskArgs(val asyncPrimaryDisk: Output<RegionDiskAsyncPrimaryDiskArgs>? = null, val description: Output<String>? = null, val diskEncryptionKey: Output<RegionDiskDiskEncryptionKeyArgs>? = null, val guestOsFeatures: Output<List<RegionDiskGuestOsFeatureArgs>>? = null, val interface: Output<String>? = null, val labels: Output<Map<String, String>>? = null, val licenses: Output<List<String>>? = null, val name: Output<String>? = null, val physicalBlockSizeBytes: Output<Int>? = null, val project: Output<String>? = null, val region: Output<String>? = null, val replicaZones: Output<List<String>>? = null, val size: Output<Int>? = null, val snapshot: Output<String>? = null, val sourceDisk: Output<String>? = null, val sourceSnapshotEncryptionKey: Output<RegionDiskSourceSnapshotEncryptionKeyArgs>? = null, val type: Output<String>? = null) : ConvertibleToJava<RegionDiskArgs>

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

Constructors

Link copied to clipboard
constructor(asyncPrimaryDisk: Output<RegionDiskAsyncPrimaryDiskArgs>? = null, description: Output<String>? = null, diskEncryptionKey: Output<RegionDiskDiskEncryptionKeyArgs>? = null, guestOsFeatures: Output<List<RegionDiskGuestOsFeatureArgs>>? = null, interface: Output<String>? = null, labels: Output<Map<String, String>>? = null, licenses: Output<List<String>>? = null, name: Output<String>? = null, physicalBlockSizeBytes: Output<Int>? = null, project: Output<String>? = null, region: Output<String>? = null, replicaZones: Output<List<String>>? = null, size: Output<Int>? = null, snapshot: Output<String>? = null, sourceDisk: Output<String>? = null, sourceSnapshotEncryptionKey: Output<RegionDiskSourceSnapshotEncryptionKeyArgs>? = null, type: Output<String>? = null)

Properties

Link copied to clipboard

A nested object resource Structure is documented below.

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

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 interface: Output<String>? = null

(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
val labels: Output<Map<String, String>>? = null

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

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

Any applicable license URI.

Link copied to clipboard
val name: Output<String>? = null

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
val physicalBlockSizeBytes: Output<Int>? = null

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>? = null

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 region: Output<String>? = null

A reference to the region where the disk resides.

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

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

Link copied to clipboard
val size: Output<Int>? = null

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>? = null

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>? = null

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

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
val type: Output<String>? = null

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

Functions

Link copied to clipboard
open override fun toJava(): RegionDiskArgs