1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. compute
  5. getRegionDisk
Google Cloud v8.23.0 published on Monday, Mar 24, 2025 by Pulumi

gcp.compute.getRegionDisk

Explore with Pulumi AI

Google Cloud v8.23.0 published on Monday, Mar 24, 2025 by Pulumi

Get information about a Google Compute Regional Persistent disks.

the official documentation and its API.

Example Usage

Coming soon!
Coming soon!
Coming soon!
Coming soon!
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.ComputeFunctions;
import com.pulumi.gcp.compute.inputs.GetRegionDiskArgs;
import com.pulumi.gcp.compute.Instance;
import com.pulumi.gcp.compute.InstanceArgs;
import com.pulumi.gcp.compute.inputs.InstanceAttachedDiskArgs;
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) {
        final var disk = ComputeFunctions.getRegionDisk(GetRegionDiskArgs.builder()
            .name("persistent-regional-disk")
            .project("example")
            .region("us-central1")
            .type("pd-ssd")
            .physicalBlockSizeBytes(4096)
            .replicaZones(            
                "us-central1-a",
                "us-central1-f")
            .build());

        var default_ = new Instance("default", InstanceArgs.builder()
            .attachedDisks(InstanceAttachedDiskArgs.builder()
                .source(diskGoogleComputeDisk.selfLink())
                .build())
            .build());

    }
}
Copy
resources:
  default:
    type: gcp:compute:Instance
    properties:
      attachedDisks:
        - source: ${diskGoogleComputeDisk.selfLink}
variables:
  disk:
    fn::invoke:
      function: gcp:compute:getRegionDisk
      arguments:
        name: persistent-regional-disk
        project: example
        region: us-central1
        type: pd-ssd
        physicalBlockSizeBytes: 4096
        replicaZones:
          - us-central1-a
          - us-central1-f
Copy

Using getRegionDisk

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getRegionDisk(args: GetRegionDiskArgs, opts?: InvokeOptions): Promise<GetRegionDiskResult>
function getRegionDiskOutput(args: GetRegionDiskOutputArgs, opts?: InvokeOptions): Output<GetRegionDiskResult>
Copy
def get_region_disk(name: Optional[str] = None,
                    project: Optional[str] = None,
                    region: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetRegionDiskResult
def get_region_disk_output(name: Optional[pulumi.Input[str]] = None,
                    project: Optional[pulumi.Input[str]] = None,
                    region: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetRegionDiskResult]
Copy
func LookupRegionDisk(ctx *Context, args *LookupRegionDiskArgs, opts ...InvokeOption) (*LookupRegionDiskResult, error)
func LookupRegionDiskOutput(ctx *Context, args *LookupRegionDiskOutputArgs, opts ...InvokeOption) LookupRegionDiskResultOutput
Copy

> Note: This function is named LookupRegionDisk in the Go SDK.

public static class GetRegionDisk 
{
    public static Task<GetRegionDiskResult> InvokeAsync(GetRegionDiskArgs args, InvokeOptions? opts = null)
    public static Output<GetRegionDiskResult> Invoke(GetRegionDiskInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetRegionDiskResult> getRegionDisk(GetRegionDiskArgs args, InvokeOptions options)
public static Output<GetRegionDiskResult> getRegionDisk(GetRegionDiskArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: gcp:compute/getRegionDisk:getRegionDisk
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Name This property is required. string
The name of a specific disk.


Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Region string
A reference to the region where the disk resides.
Name This property is required. string
The name of a specific disk.


Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Region string
A reference to the region where the disk resides.
name This property is required. String
The name of a specific disk.


project String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region String
A reference to the region where the disk resides.
name This property is required. string
The name of a specific disk.


project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region string
A reference to the region where the disk resides.
name This property is required. str
The name of a specific disk.


project str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region str
A reference to the region where the disk resides.
name This property is required. String
The name of a specific disk.


project String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region String
A reference to the region where the disk resides.

getRegionDisk Result

The following output properties are available:

AsyncPrimaryDisks List<GetRegionDiskAsyncPrimaryDisk>
CreateSnapshotBeforeDestroy bool
CreateSnapshotBeforeDestroyPrefix string
CreationTimestamp string
Description string
DiskEncryptionKeys List<GetRegionDiskDiskEncryptionKey>
EffectiveLabels Dictionary<string, string>
GuestOsFeatures List<GetRegionDiskGuestOsFeature>
Id string
The provider-assigned unique ID for this managed resource.
Interface string
LabelFingerprint string
Labels Dictionary<string, string>
LastAttachTimestamp string
LastDetachTimestamp string
Licenses List<string>
Name string
PhysicalBlockSizeBytes int
PulumiLabels Dictionary<string, string>
ReplicaZones List<string>
SelfLink string
Size int
Snapshot string
SourceDisk string
SourceDiskId string
SourceSnapshotEncryptionKeys List<GetRegionDiskSourceSnapshotEncryptionKey>
SourceSnapshotId string
Type string
Users List<string>
Project string
Region string
asyncPrimaryDisks List<GetRegionDiskAsyncPrimaryDisk>
createSnapshotBeforeDestroy Boolean
createSnapshotBeforeDestroyPrefix String
creationTimestamp String
description String
diskEncryptionKeys List<GetRegionDiskDiskEncryptionKey>
effectiveLabels Map<String,String>
guestOsFeatures List<GetRegionDiskGuestOsFeature>
id String
The provider-assigned unique ID for this managed resource.
interface_ String
labelFingerprint String
labels Map<String,String>
lastAttachTimestamp String
lastDetachTimestamp String
licenses List<String>
name String
physicalBlockSizeBytes Integer
pulumiLabels Map<String,String>
replicaZones List<String>
selfLink String
size Integer
snapshot String
sourceDisk String
sourceDiskId String
sourceSnapshotEncryptionKeys List<GetRegionDiskSourceSnapshotEncryptionKey>
sourceSnapshotId String
type String
users List<String>
project String
region String
async_primary_disks Sequence[GetRegionDiskAsyncPrimaryDisk]
create_snapshot_before_destroy bool
create_snapshot_before_destroy_prefix str
creation_timestamp str
description str
disk_encryption_keys Sequence[GetRegionDiskDiskEncryptionKey]
effective_labels Mapping[str, str]
guest_os_features Sequence[GetRegionDiskGuestOsFeature]
id str
The provider-assigned unique ID for this managed resource.
interface str
label_fingerprint str
labels Mapping[str, str]
last_attach_timestamp str
last_detach_timestamp str
licenses Sequence[str]
name str
physical_block_size_bytes int
pulumi_labels Mapping[str, str]
replica_zones Sequence[str]
self_link str
size int
snapshot str
source_disk str
source_disk_id str
source_snapshot_encryption_keys Sequence[GetRegionDiskSourceSnapshotEncryptionKey]
source_snapshot_id str
type str
users Sequence[str]
project str
region str

Supporting Types

GetRegionDiskAsyncPrimaryDisk

Disk This property is required. string
Primary disk for asynchronous disk replication.
Disk This property is required. string
Primary disk for asynchronous disk replication.
disk This property is required. String
Primary disk for asynchronous disk replication.
disk This property is required. string
Primary disk for asynchronous disk replication.
disk This property is required. str
Primary disk for asynchronous disk replication.
disk This property is required. String
Primary disk for asynchronous disk replication.

GetRegionDiskDiskEncryptionKey

KmsKeyName This property is required. string
The name of the encryption key that is stored in Google Cloud KMS.
RawKey This property is required. string
Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
RsaEncryptedKey This property is required. string
Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey.
Sha256 This property is required. string
The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
KmsKeyName This property is required. string
The name of the encryption key that is stored in Google Cloud KMS.
RawKey This property is required. string
Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
RsaEncryptedKey This property is required. string
Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey.
Sha256 This property is required. string
The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
kmsKeyName This property is required. String
The name of the encryption key that is stored in Google Cloud KMS.
rawKey This property is required. String
Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
rsaEncryptedKey This property is required. String
Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey.
sha256 This property is required. String
The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
kmsKeyName This property is required. string
The name of the encryption key that is stored in Google Cloud KMS.
rawKey This property is required. string
Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
rsaEncryptedKey This property is required. string
Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey.
sha256 This property is required. string
The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
kms_key_name This property is required. str
The name of the encryption key that is stored in Google Cloud KMS.
raw_key This property is required. str
Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
rsa_encrypted_key This property is required. str
Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey.
sha256 This property is required. str
The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
kmsKeyName This property is required. String
The name of the encryption key that is stored in Google Cloud KMS.
rawKey This property is required. String
Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
rsaEncryptedKey This property is required. String
Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource. You can provide either the rawKey or the rsaEncryptedKey.
sha256 This property is required. String
The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

GetRegionDiskGuestOsFeature

Type This property is required. string
The type of supported feature. Read Enabling guest operating system features to see a list of available options. Possible values: ["MULTI_IP_SUBNET", "SECURE_BOOT", "SEV_CAPABLE", "UEFI_COMPATIBLE", "VIRTIO_SCSI_MULTIQUEUE", "WINDOWS", "GVNIC", "SEV_LIVE_MIGRATABLE", "SEV_SNP_CAPABLE", "SUSPEND_RESUME_COMPATIBLE", "TDX_CAPABLE"]
Type This property is required. string
The type of supported feature. Read Enabling guest operating system features to see a list of available options. Possible values: ["MULTI_IP_SUBNET", "SECURE_BOOT", "SEV_CAPABLE", "UEFI_COMPATIBLE", "VIRTIO_SCSI_MULTIQUEUE", "WINDOWS", "GVNIC", "SEV_LIVE_MIGRATABLE", "SEV_SNP_CAPABLE", "SUSPEND_RESUME_COMPATIBLE", "TDX_CAPABLE"]
type This property is required. String
The type of supported feature. Read Enabling guest operating system features to see a list of available options. Possible values: ["MULTI_IP_SUBNET", "SECURE_BOOT", "SEV_CAPABLE", "UEFI_COMPATIBLE", "VIRTIO_SCSI_MULTIQUEUE", "WINDOWS", "GVNIC", "SEV_LIVE_MIGRATABLE", "SEV_SNP_CAPABLE", "SUSPEND_RESUME_COMPATIBLE", "TDX_CAPABLE"]
type This property is required. string
The type of supported feature. Read Enabling guest operating system features to see a list of available options. Possible values: ["MULTI_IP_SUBNET", "SECURE_BOOT", "SEV_CAPABLE", "UEFI_COMPATIBLE", "VIRTIO_SCSI_MULTIQUEUE", "WINDOWS", "GVNIC", "SEV_LIVE_MIGRATABLE", "SEV_SNP_CAPABLE", "SUSPEND_RESUME_COMPATIBLE", "TDX_CAPABLE"]
type This property is required. str
The type of supported feature. Read Enabling guest operating system features to see a list of available options. Possible values: ["MULTI_IP_SUBNET", "SECURE_BOOT", "SEV_CAPABLE", "UEFI_COMPATIBLE", "VIRTIO_SCSI_MULTIQUEUE", "WINDOWS", "GVNIC", "SEV_LIVE_MIGRATABLE", "SEV_SNP_CAPABLE", "SUSPEND_RESUME_COMPATIBLE", "TDX_CAPABLE"]
type This property is required. String
The type of supported feature. Read Enabling guest operating system features to see a list of available options. Possible values: ["MULTI_IP_SUBNET", "SECURE_BOOT", "SEV_CAPABLE", "UEFI_COMPATIBLE", "VIRTIO_SCSI_MULTIQUEUE", "WINDOWS", "GVNIC", "SEV_LIVE_MIGRATABLE", "SEV_SNP_CAPABLE", "SUSPEND_RESUME_COMPATIBLE", "TDX_CAPABLE"]

GetRegionDiskSourceSnapshotEncryptionKey

KmsKeyName This property is required. string
The name of the encryption key that is stored in Google Cloud KMS.
RawKey This property is required. string
Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
Sha256 This property is required. string
The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
KmsKeyName This property is required. string
The name of the encryption key that is stored in Google Cloud KMS.
RawKey This property is required. string
Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
Sha256 This property is required. string
The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
kmsKeyName This property is required. String
The name of the encryption key that is stored in Google Cloud KMS.
rawKey This property is required. String
Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
sha256 This property is required. String
The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
kmsKeyName This property is required. string
The name of the encryption key that is stored in Google Cloud KMS.
rawKey This property is required. string
Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
sha256 This property is required. string
The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
kms_key_name This property is required. str
The name of the encryption key that is stored in Google Cloud KMS.
raw_key This property is required. str
Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
sha256 This property is required. str
The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
kmsKeyName This property is required. String
The name of the encryption key that is stored in Google Cloud KMS.
rawKey This property is required. String
Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
sha256 This property is required. String
The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.

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.
Google Cloud v8.23.0 published on Monday, Mar 24, 2025 by Pulumi