EbsDeviceOptions
- class aws_cdk.aws_ec2.EbsDeviceOptions(*, delete_on_termination=None, iops=None, throughput=None, volume_type=None, encrypted=None, kms_key=None)
Bases:
EbsDeviceOptionsBaseBlock device options for an EBS volume.
- Parameters:
delete_on_termination (
Optional[bool]) – Indicates whether to delete the volume when the instance is terminated. Default: - true for Amazon EC2 Auto Scaling, false otherwise (e.g. EBS)iops (
Union[int,float,None]) – The number of I/O operations per second (IOPS) to provision for the volume. Must only be set forvolumeType:EbsDeviceVolumeType.IO1The 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: - none, required forEbsDeviceVolumeType.IO1throughput (
Union[int,float,None]) – The throughput to provision for agp3volume. Valid Range: Minimum value of 125. Maximum value of 2000.gp3volumes 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. Default: - 125 MiB/s.volume_type (
Optional[EbsDeviceVolumeType]) – The EBS volume type. Default:EbsDeviceVolumeType.GENERAL_PURPOSE_SSDorEbsDeviceVolumeType.GENERAL_PURPOSE_SSD_GP3if@aws-cdk/aws-ec2:ebsDefaultGp3Volumeis enabled.encrypted (
Optional[bool]) – Specifies whether the EBS volume is encrypted. Encrypted EBS volumes can only be attached to instances that support Amazon EBS encryption Default: falsekms_key (
Optional[IKey]) – The ARN of the AWS Key Management Service (AWS KMS) CMK used for encryption. You have to ensure that the KMS CMK has the correct permissions to be used by the service launching the ec2 instances. Default: - If encrypted is true, the default aws/ebs KMS key will be used.
- ExampleMetadata:
infused
Example:
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 ) ) ] )
Attributes
- delete_on_termination
Indicates whether to delete the volume when the instance is terminated.
- Default:
true for Amazon EC2 Auto Scaling, false otherwise (e.g. EBS)
- encrypted
Specifies whether the EBS volume is encrypted.
Encrypted EBS volumes can only be attached to instances that support Amazon EBS encryption
- iops
The number of I/O operations per second (IOPS) to provision for the volume.
Must only be set for
volumeType:EbsDeviceVolumeType.IO1The 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:
none, required for
EbsDeviceVolumeType.IO1
- See:
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html
- kms_key
The ARN of the AWS Key Management Service (AWS KMS) CMK used for encryption.
You have to ensure that the KMS CMK has the correct permissions to be used by the service launching the ec2 instances.
- Default:
If encrypted is true, the default aws/ebs KMS key will be used.
- See:
- throughput
The throughput to provision for a
gp3volume.Valid Range: Minimum value of 125. Maximum value of 2000.
gp3volumes 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.
- volume_type
The EBS volume type.
- Default:
EbsDeviceVolumeType.GENERAL_PURPOSE_SSDorEbsDeviceVolumeType.GENERAL_PURPOSE_SSD_GP3if@aws-cdk/aws-ec2:ebsDefaultGp3Volumeis enabled.