Table of Contents

Class CfnLaunchConfiguration.BlockDeviceMappingProperty

Namespace
Amazon.CDK.AWS.AutoScaling
Assembly
Amazon.CDK.AWS.AutoScaling.dll

BlockDeviceMapping specifies a block device mapping for the BlockDeviceMappings property of the AWS::AutoScaling::LaunchConfiguration resource.

public class CfnLaunchConfiguration.BlockDeviceMappingProperty : CfnLaunchConfiguration.IBlockDeviceMappingProperty
Inheritance
CfnLaunchConfiguration.BlockDeviceMappingProperty
Implements
Inherited Members

Examples

// The code below shows an example of how to instantiate this type.
             // The values are placeholders you should change.
             using Amazon.CDK.AWS.AutoScaling;

             var blockDeviceMappingProperty = new BlockDeviceMappingProperty {
                 DeviceName = "deviceName",

                 // the properties below are optional
                 Ebs = new BlockDeviceProperty {
                     DeleteOnTermination = false,
                     Encrypted = false,
                     Iops = 123,
                     SnapshotId = "snapshotId",
                     Throughput = 123,
                     VolumeSize = 123,
                     VolumeType = "volumeType"
                 },
                 NoDevice = false,
                 VirtualName = "virtualName"
             };

Remarks

Each instance that is launched has an associated root device volume, either an Amazon EBS volume or an instance store volume. You can use block device mappings to specify additional EBS volumes or instance store volumes to attach to an instance when it is launched.

For more information, see Example block device mapping in the Amazon EC2 User Guide for Linux Instances .

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-launchconfiguration-blockdevicemapping.html

ExampleMetadata: fixture=_generated

Constructors

BlockDeviceMappingProperty()

public BlockDeviceMappingProperty()

Properties

DeviceName

The device name assigned to the volume (for example, /dev/sdh or xvdh ).

public string DeviceName { get; set; }

Property Value

string

Remarks

For more information, see Device naming on Linux instances in the Amazon EC2 User Guide for Linux Instances .

To define a block device mapping, set the device name and exactly one of the following properties: <code>Ebs</code> , <code>NoDevice</code> , or <code>VirtualName</code> .

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-launchconfiguration-blockdevicemapping.html#cfn-autoscaling-launchconfiguration-blockdevicemapping-devicename

Ebs

Information to attach an EBS volume to an instance at launch.

public object? Ebs { get; set; }

Property Value

object

Remarks

NoDevice

Setting this value to true prevents a volume that is included in the block device mapping of the AMI from being mapped to the specified device name at launch.

public object? NoDevice { get; set; }

Property Value

object

Remarks

If NoDevice is true for the root device, instances might fail the EC2 health check. In that case, Amazon EC2 Auto Scaling launches replacement instances.

Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-launchconfiguration-blockdevicemapping.html#cfn-autoscaling-launchconfiguration-blockdevicemapping-nodevice

VirtualName

The name of the instance store volume (virtual device) to attach to an instance at launch.

public string? VirtualName { get; set; }

Property Value

string

Remarks