Skip to content
v2.274.0

EbsDeviceOptions Struct ​

Block device options for an EBS volume.

Example ​

ts
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
      })
    }
  ]
});

Properties ​

deleteOnTerminationoptionalbooleandelete_on_terminationoptionalbooldeleteOnTerminationoptionalBooleanDeleteOnTerminationoptionalboolDeleteOnTerminationoptional*bool#
Indicates whether to delete the volume when the instance is terminated.

Default: true for Amazon EC2 Auto Scaling, false otherwise (e.g. EBS)

encryptedoptionalbooleanencryptedoptionalboolencryptedoptionalBooleanEncryptedoptionalboolEncryptedoptional*bool= false#
Specifies whether the EBS volume is encrypted.

Encrypted EBS volumes can only be attached to instances that support Amazon EBS encryption

iopsoptionalnumberiopsoptionalint | floatiopsoptionalNumberIopsoptionaldoubleIopsoptional*float64#
The number of I/O operations per second (IOPS) to provision for the volume.

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.

kmsKeyoptionalIKeykms_keyoptionalIKeykmsKeyoptionalIKeyKmsKeyoptionalIKeyKmsKeyoptionalIKey#
The ARN of the AWS Key Management Service (AWS KMS) CMK used for encryption.

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#
The throughput to provision for a `gp3` volume.

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#
The Amazon EBS Provisioned Rate for Volume Initialization, at which to download the snapshot blocks from Amazon S3 to the volume.

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#
The EBS volume type.

Default: EbsDeviceVolumeType.GENERAL_PURPOSE_SSD or EbsDeviceVolumeType.GENERAL_PURPOSE_SSD_GP3 if @aws-cdk/aws-ec2:ebsDefaultGp3Volume is enabled.