BlockDevice

class aws_cdk.aws_ec2.BlockDevice(*, device_name, volume, mapping_enabled=None)

Bases: object

Block device.

Parameters:
  • device_name (str) – The device name exposed to the EC2 instance. For example, a value like /dev/sdh, xvdh.

  • volume (BlockDeviceVolume) – Defines the block device volume, to be either an Amazon EBS volume or an ephemeral instance store volume. For example, a value like BlockDeviceVolume.ebs(15), BlockDeviceVolume.ephemeral(0).

  • mapping_enabled (Optional[bool]) – If false, the device mapping will be suppressed. 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

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_ec2 as ec2

# block_device_volume: ec2.BlockDeviceVolume

block_device = ec2.BlockDevice(
    device_name="deviceName",
    volume=block_device_volume,

    # the properties below are optional
    mapping_enabled=False
)

Attributes

device_name

The device name exposed to the EC2 instance.

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

See:

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

mapping_enabled

If false, the device mapping will be suppressed.

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.

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