Class CfnVolumeAttachment
Attaches an Amazon EBS volume to a running instance and exposes it to the instance with the specified device name.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnVolumeAttachment : CfnResource, IInspectable
Syntax (vb)
Public Class CfnVolumeAttachment
Inherits CfnResource
Implements IInspectable
Remarks
Before this resource can be deleted (and therefore the volume detached), you must first unmount the volume in the instance. Failure to do so results in the volume being stuck in the busy state while it is trying to detach, which could possibly damage the file system or the data it contains.
If an Amazon EBS volume is the root device of an instance, it cannot be detached while the instance is in the "running" state. To detach the root volume, stop the instance first.
If the root volume is detached from an instance with an AWS Marketplace product code, then the product codes from that volume are no longer associated with the instance.
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-volumeattachment.html
CloudformationResource: AWS::EC2::VolumeAttachment
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.EC2;
var cfnVolumeAttachment = new CfnVolumeAttachment(this, "MyCfnVolumeAttachment", new CfnVolumeAttachmentProps {
InstanceId = "instanceId",
VolumeId = "volumeId",
// the properties below are optional
Device = "device"
});
Synopsis
Constructors
CfnVolumeAttachment(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnVolumeAttachment(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
CfnVolumeAttachment(Construct, String, ICfnVolumeAttachmentProps) |
Properties
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
Device | The device name (for example, |
InstanceId | The ID of the instance to which the volume attaches. |
VolumeId | The ID of the Amazon EBS volume. |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnVolumeAttachment(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnVolumeAttachment(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnVolumeAttachment(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnVolumeAttachment(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
CfnVolumeAttachment(Construct, String, ICfnVolumeAttachmentProps)
public CfnVolumeAttachment(Construct scope, string id, ICfnVolumeAttachmentProps props)
Parameters
- scope Constructs.Construct
Scope in which this resource is defined.
- id System.String
Construct identifier for this resource (unique in its scope).
- props ICfnVolumeAttachmentProps
Resource properties.
Properties
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
System.String
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Overrides
Device
The device name (for example, /dev/sdh
or xvdh
).
public virtual string Device { get; set; }
Property Value
System.String
InstanceId
The ID of the instance to which the volume attaches.
public virtual string InstanceId { get; set; }
Property Value
System.String
VolumeId
The ID of the Amazon EBS volume.
public virtual string VolumeId { get; set; }
Property Value
System.String
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector TreeInspector
tree inspector to collect and process attributes.
RenderProperties(IDictionary<String, Object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props System.Collections.Generic.IDictionary<System.String, System.Object>
Returns
System.Collections.Generic.IDictionary<System.String, System.Object>