EbsDeviceOptions Struct
Block device options for an EBS volume.
| Source | aws-ec2/lib/volume.ts |
|---|---|
| Type last changed |
Example
const imageRecipe = new imagebuilder.ImageRecipe(this, 'BlockDeviceImageRecipe', {
baseImage: imagebuilder.BaseImage.fromSsmParameterName(
'/aws/service/ami-amazon-linux-latest/al2023-ami-minimal-kernel-default-x86_64'
),
blockDevices: [
{
deviceName: '/dev/sda1',
volume: ec2.BlockDeviceVolume.ebs(100, {
encrypted: true,
volumeType: ec2.EbsDeviceVolumeType.GENERAL_PURPOSE_SSD_GP3
})
}
]
});
image_recipe = imagebuilder.ImageRecipe(self, "BlockDeviceImageRecipe",
base_image=imagebuilder.BaseImage.from_ssm_parameter_name("/aws/service/ami-amazon-linux-latest/al2023-ami-minimal-kernel-default-x86_64"),
block_devices=[ec2.BlockDevice(
device_name="/dev/sda1",
volume=ec2.BlockDeviceVolume.ebs(100,
encrypted=True,
volume_type=ec2.EbsDeviceVolumeType.GENERAL_PURPOSE_SSD_GP3
)
)
]
)
ImageRecipe imageRecipe = ImageRecipe.Builder.create(this, "BlockDeviceImageRecipe")
.baseImage(BaseImage.fromSsmParameterName("/aws/service/ami-amazon-linux-latest/al2023-ami-minimal-kernel-default-x86_64"))
.blockDevices(List.of(BlockDevice.builder()
.deviceName("/dev/sda1")
.volume(BlockDeviceVolume.ebs(100, EbsDeviceOptions.builder()
.encrypted(true)
.volumeType(EbsDeviceVolumeType.GENERAL_PURPOSE_SSD_GP3)
.build()))
.build()))
.build();
// Install: dotnet add package Amazon.CDK.Lib
var imageRecipe = new ImageRecipe(this, "BlockDeviceImageRecipe", new ImageRecipeProps {
BaseImage = BaseImage.FromSsmParameterName("/aws/service/ami-amazon-linux-latest/al2023-ami-minimal-kernel-default-x86_64"),
BlockDevices = new [] { new BlockDevice {
DeviceName = "/dev/sda1",
Volume = BlockDeviceVolume.Ebs(100, new EbsDeviceOptions {
Encrypted = true,
VolumeType = EbsDeviceVolumeType.GENERAL_PURPOSE_SSD_GP3
})
} }
});
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
imageRecipe := imagebuilder.NewImageRecipe(this, jsii.String("BlockDeviceImageRecipe"), &ImageRecipeProps{
BaseImage: imagebuilder.BaseImage_*FromSsmParameterName(jsii.String("/aws/service/ami-amazon-linux-latest/al2023-ami-minimal-kernel-default-x86_64")),
BlockDevices: []BlockDevice{
&BlockDevice{
DeviceName: jsii.String("/dev/sda1"),
Volume: ec2.BlockDeviceVolume_Ebs(jsii.Number(100), &EbsDeviceOptions{
Encrypted: jsii.Boolean(true),
VolumeType: ec2.EbsDeviceVolumeType_GENERAL_PURPOSE_SSD_GP3,
}),
},
},
})
Properties
deleteOnTerminationoptionalbooleandelete_on_terminationoptionalbooldeleteOnTerminationoptionalBooleanDeleteOnTerminationoptionalboolDeleteOnTerminationoptional*bool #Default: true for Amazon EC2 Auto Scaling, false otherwise (e.g. EBS)
encryptedoptionalbooleanencryptedoptionalboolencryptedoptionalBooleanEncryptedoptionalboolEncryptedoptional*bool = false #Encrypted EBS volumes can only be attached to instances that support Amazon EBS encryption
Default: none, required for EbsDeviceVolumeType.IO1
Must only be set for volumeType: EbsDeviceVolumeType.IO1
The maximum ratio of IOPS to volume size (in GiB) is 50:1, so for 5,000 provisioned IOPS, you need at least 100 GiB storage on the volume.
Default: If encrypted is true, the default aws/ebs KMS key will be used.
You have to ensure that the KMS CMK has the correct permissions to be used by the service launching the ec2 instances.
throughputoptionalnumberthroughputoptionalint | floatthroughputoptionalNumberThroughputoptionaldoubleThroughputoptional*float64 #Default: 125 MiB/s.
notes
Valid Range: Minimum value of 125. Maximum value of 2000.
gp3 volumes deliver a consistent baseline throughput performance of 125 MiB/s. You can provision additional throughput for an additional cost at a ratio of 0.25 MiB/s per provisioned IOPS.
volumeInitializationRateoptionalSizevolume_initialization_rateoptionalSizevolumeInitializationRateoptionalSizeVolumeInitializationRateoptionalSizeVolumeInitializationRateoptionalSize #Default: undefined - The volume initialization rate is not set.
Valid range is between 100 and 300 MiB/s. This parameter is supported only for volumes created from snapshots.
volumeTypeoptionalEbsDeviceVolumeTypevolume_typeoptionalEbsDeviceVolumeTypevolumeTypeoptionalEbsDeviceVolumeTypeVolumeTypeoptionalEbsDeviceVolumeTypeVolumeTypeoptionalEbsDeviceVolumeType #Default: EbsDeviceVolumeType.GENERAL_PURPOSE_SSD or EbsDeviceVolumeType.GENERAL_PURPOSE_SSD_GP3 if @aws-cdk/aws-ec2:ebsDefaultGp3Volume is enabled.