Show / Hide Table of Contents

Class BlockDevice

Block device.

Inheritance
object
BlockDevice
Implements
IBlockDevice
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class BlockDevice : IBlockDevice
Syntax (vb)
Public Class BlockDevice Implements IBlockDevice
Remarks

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;

            BlockDeviceVolume blockDeviceVolume;

            var blockDevice = new BlockDevice {
                DeviceName = "deviceName",
                Volume = blockDeviceVolume,

                // the properties below are optional
                MappingEnabled = false
            };

Synopsis

Constructors

BlockDevice()

Block device.

Properties

DeviceName

The device name exposed to the EC2 instance.

MappingEnabled

If false, the device mapping will be suppressed.

Volume

Defines the block device volume, to be either an Amazon EBS volume or an ephemeral instance store volume.

Constructors

BlockDevice()

Block device.

public BlockDevice()
Remarks

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;

            BlockDeviceVolume blockDeviceVolume;

            var blockDevice = new BlockDevice {
                DeviceName = "deviceName",
                Volume = blockDeviceVolume,

                // the properties below are optional
                MappingEnabled = false
            };

Properties

DeviceName

The device name exposed to the EC2 instance.

public string DeviceName { get; set; }
Property Value

string

Remarks

For example, a value like /dev/sdh, xvdh.

See: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/device_naming.html

MappingEnabled

If false, the device mapping will be suppressed.

public bool? MappingEnabled { get; set; }
Property Value

bool?

Remarks

If set to false for the root device, the instance might fail the Amazon EC2 health check. Amazon EC2 Auto Scaling launches a replacement instance if the instance fails the health check.

Default: true - device mapping is left untouched

Volume

Defines the block device volume, to be either an Amazon EBS volume or an ephemeral instance store volume.

public BlockDeviceVolume Volume { get; set; }
Property Value

BlockDeviceVolume

Remarks

For example, a value like BlockDeviceVolume.ebs(15), BlockDeviceVolume.ephemeral(0).

Implements

IBlockDevice
Back to top Generated by DocFX