BlockDeviceMappingProperty Struct
Specifies a block device mapping.
You can specify Ebs or VirtualName , but not both.
| Source | |
|---|---|
| Type last changed |
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
const blockDeviceMappingProperty: ec2.CfnSpotFleet.BlockDeviceMappingProperty = {
deviceName: 'deviceName',
// the properties below are optional
ebs: {
deleteOnTermination: false,
encrypted: false,
iops: 123,
snapshotId: 'snapshotId',
volumeSize: 123,
volumeType: 'volumeType',
},
noDevice: 'noDevice',
virtualName: 'virtualName',
};
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2
block_device_mapping_property = ec2.CfnSpotFleet.BlockDeviceMappingProperty(
device_name="deviceName",
# the properties below are optional
ebs=ec2.CfnSpotFleet.EbsBlockDeviceProperty(
delete_on_termination=False,
encrypted=False,
iops=123,
snapshot_id="snapshotId",
volume_size=123,
volume_type="volumeType"
),
no_device="noDevice",
virtual_name="virtualName"
)
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.ec2.*;
BlockDeviceMappingProperty blockDeviceMappingProperty = BlockDeviceMappingProperty.builder()
.deviceName("deviceName")
// the properties below are optional
.ebs(EbsBlockDeviceProperty.builder()
.deleteOnTermination(false)
.encrypted(false)
.iops(123)
.snapshotId("snapshotId")
.volumeSize(123)
.volumeType("volumeType")
.build())
.noDevice("noDevice")
.virtualName("virtualName")
.build();
// 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.EC2;
var blockDeviceMappingProperty = new BlockDeviceMappingProperty {
DeviceName = "deviceName",
// the properties below are optional
Ebs = new EbsBlockDeviceProperty {
DeleteOnTermination = false,
Encrypted = false,
Iops = 123,
SnapshotId = "snapshotId",
VolumeSize = 123,
VolumeType = "volumeType"
},
NoDevice = "noDevice",
VirtualName = "virtualName"
};
// 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"
blockDeviceMappingProperty := &BlockDeviceMappingProperty{
DeviceName: jsii.String("deviceName"),
// the properties below are optional
Ebs: &EbsBlockDeviceProperty{
DeleteOnTermination: jsii.Boolean(false),
Encrypted: jsii.Boolean(false),
Iops: jsii.Number(123),
SnapshotId: jsii.String("snapshotId"),
VolumeSize: jsii.Number(123),
VolumeType: jsii.String("volumeType"),
},
NoDevice: jsii.String("noDevice"),
VirtualName: jsii.String("virtualName"),
}
Properties
For available device names, see Device names for volumes .
ebsoptionalIResolvable | CfnSpotFleet.ebsoptionaltyping.Union[IResolvable, EbsBlockDeviceProperty]ebsoptionalIResolvableEbsoptionalIResolvableEbsoptionalinterface{} #noDeviceoptionalstringno_deviceoptionalstrnoDeviceoptionalStringNoDeviceoptionalstringNoDeviceoptional*string #When this property is specified, the device is removed from the block device mapping regardless of the assigned value.
virtualNameoptionalstringvirtual_nameoptionalstrvirtualNameoptionalStringVirtualNameoptionalstringVirtualNameoptional*string #notes
Instance store volumes are numbered starting from 0. An instance type with 2 available instance store volumes can specify mappings for ephemeral0 and ephemeral1 . The number of available instance store volumes depends on the instance type. After you connect to the instance, you must mount the volume.
NVMe instance store volumes are automatically enumerated and assigned a device name. Including them in your block device mapping has no effect.
Constraints: For M3 instances, you must specify instance store volumes in the block device mapping for the instance. When you launch an M3 instance, we ignore any instance store volumes specified in the block device mapping for the AMI.