Show / Hide Table of Contents

Class AttachedDisk

Persistent disks can be attached to a compute instance using the attached_disk section within the compute instance configuration. However there may be situations where managing the attached disks via the compute instance config isn't preferable or possible, such as attaching dynamic numbers of disks using the count variable.

To get more information about attaching disks, see:

  • API documentation
  • How-to Guides
  • Adding a persistent disk

Note: When using gcp.compute.AttachedDisk you must use lifecycle.ignore_changes = ["attached_disk"] on the gcp.compute.Instance resource that has the disks attached. Otherwise the two resources will fight for control of the attached disk block.

Inheritance
System.Object
Resource
CustomResource
AttachedDisk
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 AttachedDisk : CustomResource

Constructors

View Source

AttachedDisk(String, AttachedDiskArgs, CustomResourceOptions)

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

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

The unique name of the resource

AttachedDiskArgs 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

DeviceName

Specifies a unique device name of your choice that is reflected into the /dev/disk/by-id/google-* tree of a Linux operating system running within the instance. This name can be used to reference the device for mounting, resizing, and so on, from within the instance.

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

Disk

name or self_link of the disk that will be attached.

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

Instance

name or self_link of the compute instance that the disk will be attached to. If the self_link is provided then zone and project are extracted from the self link. If only the name is used then zone and project must be defined as properties on the resource or provider.

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

Mode

The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode.

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

Project

The project that the referenced compute instance is a part of. If instance is referenced by its self_link the project defined in the link will take precedence.

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

Zone

The zone that the referenced compute instance is located within. If instance is referenced by its self_link the zone defined in the link will take precedence.

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

Methods

View Source

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

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

Declaration
public static AttachedDisk Get(string name, Input<string> id, AttachedDiskState 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.

AttachedDiskState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

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