Show / Hide Table of Contents

Class RegionDisk

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:

  • API documentation
  • How-to Guides
  • Adding or Resizing Regional Persistent Disks

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

Example Usage - Region Disk Basic

using Pulumi;
using Gcp = Pulumi.Gcp;

class MyStack : Stack
{
public MyStack()
{
    var disk = new Gcp.Compute.Disk("disk", new Gcp.Compute.DiskArgs
    {
        Image = "debian-cloud/debian-9",
        Size = 50,
        Type = "pd-ssd",
        Zone = "us-central1-a",
    });
    var snapdisk = new Gcp.Compute.Snapshot("snapdisk", new Gcp.Compute.SnapshotArgs
    {
        SourceDisk = disk.Name,
        Zone = "us-central1-a",
    });
    var regiondisk = new Gcp.Compute.RegionDisk("regiondisk", new Gcp.Compute.RegionDiskArgs
    {
        Snapshot = snapdisk.Id,
        Type = "pd-ssd",
        Region = "us-central1",
        PhysicalBlockSizeBytes = 4096,
        ReplicaZones = 
        {
            "us-central1-a",
            "us-central1-f",
        },
    });
}

}
Inheritance
System.Object
Resource
CustomResource
RegionDisk
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Gcp.Compute
Assembly: Pulumi.Gcp.dll
Syntax
public class RegionDisk : CustomResource

Constructors

View Source

RegionDisk(String, RegionDiskArgs, CustomResourceOptions)

Create a RegionDisk resource with the given unique name, arguments, and options.

Declaration
public RegionDisk(string name, RegionDiskArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

RegionDiskArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

CreationTimestamp

Creation timestamp in RFC3339 text format.

Declaration
public Output<string> CreationTimestamp { get; }
Property Value
Type Description
Output<System.String>
View Source

Description

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

Declaration
public Output<string> Description { get; }
Property Value
Type Description
Output<System.String>
View Source

DiskEncryptionKey

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.

Declaration
public Output<RegionDiskDiskEncryptionKey> DiskEncryptionKey { get; }
Property Value
Type Description
Output<RegionDiskDiskEncryptionKey>
View Source

LabelFingerprint

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

Declaration
public Output<string> LabelFingerprint { get; }
Property Value
Type Description
Output<System.String>
View Source

Labels

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

Declaration
public Output<ImmutableDictionary<string, string>> Labels { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.String>>
View Source

LastAttachTimestamp

Last attach timestamp in RFC3339 text format.

Declaration
public Output<string> LastAttachTimestamp { get; }
Property Value
Type Description
Output<System.String>
View Source

LastDetachTimestamp

Last detach timestamp in RFC3339 text format.

Declaration
public Output<string> LastDetachTimestamp { get; }
Property Value
Type Description
Output<System.String>
View Source

Name

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.

Declaration
public Output<string> Name { get; }
Property Value
Type Description
Output<System.String>
View Source

PhysicalBlockSizeBytes

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.

Declaration
public Output<int> PhysicalBlockSizeBytes { get; }
Property Value
Type Description
Output<System.Int32>
View Source

Project

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

Declaration
public Output<string> Project { get; }
Property Value
Type Description
Output<System.String>
View Source

Region

A reference to the region where the disk resides.

Declaration
public Output<string> Region { get; }
Property Value
Type Description
Output<System.String>
View Source

ReplicaZones

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

Declaration
public Output<ImmutableArray<string>> ReplicaZones { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<System.String>>
View Source

SelfLink

The URI of the created resource.

Declaration
public Output<string> SelfLink { get; }
Property Value
Type Description
Output<System.String>
View Source

Size

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.

Declaration
public Output<int> Size { get; }
Property Value
Type Description
Output<System.Int32>
View Source

Snapshot

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
Declaration
public Output<string> Snapshot { get; }
Property Value
Type Description
Output<System.String>
View Source

SourceSnapshotEncryptionKey

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.

Declaration
public Output<RegionDiskSourceSnapshotEncryptionKey> SourceSnapshotEncryptionKey { get; }
Property Value
Type Description
Output<RegionDiskSourceSnapshotEncryptionKey>
View Source

SourceSnapshotId

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.

Declaration
public Output<string> SourceSnapshotId { get; }
Property Value
Type Description
Output<System.String>
View Source

Type

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

Declaration
public Output<string> Type { get; }
Property Value
Type Description
Output<System.String>
View Source

Users

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

Declaration
public Output<ImmutableArray<string>> Users { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<System.String>>

Methods

View Source

Get(String, Input<String>, RegionDiskState, CustomResourceOptions)

Get an existing RegionDisk resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static RegionDisk Get(string name, Input<string> id, RegionDiskState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

RegionDiskState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
RegionDisk
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.