Skip to content
v2.276.0

BlockDevice Struct ​

Block device.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_autoscaling as autoscaling } from 'aws-cdk-lib';

declare const blockDeviceVolume: autoscaling.BlockDeviceVolume;
const blockDevice: autoscaling.BlockDevice = {
  deviceName: 'deviceName',
  volume: blockDeviceVolume,
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_autoscaling as autoscaling

# block_device_volume: autoscaling.BlockDeviceVolume

block_device = autoscaling.BlockDevice(
    device_name="deviceName",
    volume=block_device_volume
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.autoscaling.*;

BlockDeviceVolume blockDeviceVolume;

BlockDevice blockDevice = BlockDevice.builder()
        .deviceName("deviceName")
        .volume(blockDeviceVolume)
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.AutoScaling;

BlockDeviceVolume blockDeviceVolume;

var blockDevice = new BlockDevice {
    DeviceName = "deviceName",
    Volume = blockDeviceVolume
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var blockDeviceVolume BlockDeviceVolume

blockDevice := &BlockDevice{
	DeviceName: jsii.String("deviceName"),
	Volume: blockDeviceVolume,
}

Properties ​

deviceNamestringdevice_namestrdeviceNameStringDeviceNamestringDeviceName*stringrequired#
The device name exposed to the EC2 instance.

Supply a value like /dev/sdh, xvdh.

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

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