aws-cdk-lib.aws_autoscaling.EbsDeviceOptions

interface EbsDeviceOptions

LanguageType name
.NETAmazon.CDK.AWS.AutoScaling.EbsDeviceOptions
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsautoscaling#EbsDeviceOptions
Javasoftware.amazon.awscdk.services.autoscaling.EbsDeviceOptions
Pythonaws_cdk.aws_autoscaling.EbsDeviceOptions
TypeScript (source)aws-cdk-lib » aws_autoscaling » EbsDeviceOptions

Block device options for an EBS volume.

Example

declare const vpc: ec2.Vpc;
declare const instanceType: ec2.InstanceType;
declare const machineImage: ec2.IMachineImage;

const autoScalingGroup = new autoscaling.AutoScalingGroup(this, 'ASG', {
  vpc,
  instanceType,
  machineImage,
  blockDevices: [
    {
        deviceName: 'gp3-volume',
        volume: autoscaling.BlockDeviceVolume.ebs(15, {
          volumeType: autoscaling.EbsDeviceVolumeType.GP3,
          throughput: 125,
        }),
      },
  ],
  // ...
});

Properties

NameTypeDescription
deleteOnTermination?booleanIndicates whether to delete the volume when the instance is terminated.
encrypted?booleanSpecifies whether the EBS volume is encrypted.
iops?numberThe number of I/O operations per second (IOPS) to provision for the volume.
throughput?numberThe throughput that the volume supports, in MiB/s Takes a minimum of 125 and maximum of 1000.
volumeType?EbsDeviceVolumeTypeThe EBS volume type.

deleteOnTermination?

Type: boolean (optional, default: true for Amazon EC2 Auto Scaling, false otherwise (e.g. EBS))

Indicates whether to delete the volume when the instance is terminated.


encrypted?

Type: boolean (optional, default: false)

Specifies whether the EBS volume is encrypted.

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

See also: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#EBSEncryption_supported_instances


iops?

Type: number (optional, default: none, required for EbsDeviceVolumeType.IO1)

The number of I/O operations per second (IOPS) to provision for the volume.

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.

See also: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html


throughput?

Type: number (optional, default: 125 MiB/s. Only valid on gp3 volumes.)

The throughput that the volume supports, in MiB/s Takes a minimum of 125 and maximum of 1000.

See also: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html


volumeType?

Type: EbsDeviceVolumeType (optional, default: EbsDeviceVolumeType.GP2)

The EBS volume type.

See also: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html