Skip to content
v2.278.0

EbsDeviceOptions Struct ​

Block device options for an EBS volume.

Example ​

ts
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,
        }),
      },
  ],
  // ...
});
python
# vpc: ec2.Vpc
# instance_type: ec2.InstanceType
# machine_image: ec2.IMachineImage


auto_scaling_group = autoscaling.AutoScalingGroup(self, "ASG",
    vpc=vpc,
    instance_type=instance_type,
    machine_image=machine_image,
    block_devices=[autoscaling.BlockDevice(
        device_name="gp3-volume",
        volume=autoscaling.BlockDeviceVolume.ebs(15,
            volume_type=autoscaling.EbsDeviceVolumeType.GP3,
            throughput=125
        )
    )
    ]
)
java
Vpc vpc;
InstanceType instanceType;
IMachineImage machineImage;


AutoScalingGroup autoScalingGroup = AutoScalingGroup.Builder.create(this, "ASG")
        .vpc(vpc)
        .instanceType(instanceType)
        .machineImage(machineImage)
        .blockDevices(List.of(BlockDevice.builder()
                .deviceName("gp3-volume")
                .volume(BlockDeviceVolume.ebs(15, EbsDeviceOptions.builder()
                        .volumeType(EbsDeviceVolumeType.GP3)
                        .throughput(125)
                        .build()))
                .build()))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
Vpc vpc;
InstanceType instanceType;
IMachineImage machineImage;


var autoScalingGroup = new AutoScalingGroup(this, "ASG", new AutoScalingGroupProps {
    Vpc = vpc,
    InstanceType = instanceType,
    MachineImage = machineImage,
    BlockDevices = new [] { new BlockDevice {
        DeviceName = "gp3-volume",
        Volume = BlockDeviceVolume.Ebs(15, new EbsDeviceOptions {
            VolumeType = EbsDeviceVolumeType.GP3,
            Throughput = 125
        })
    } }
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var vpc Vpc
var instanceType InstanceType
var machineImage IMachineImage


autoScalingGroup := autoscaling.NewAutoScalingGroup(this, jsii.String("ASG"), &AutoScalingGroupProps{
	Vpc: Vpc,
	InstanceType: InstanceType,
	MachineImage: MachineImage,
	BlockDevices: []BlockDevice{
		&BlockDevice{
			DeviceName: jsii.String("gp3-volume"),
			Volume: autoscaling.BlockDeviceVolume_Ebs(jsii.Number(15), &EbsDeviceOptions{
				VolumeType: autoscaling.EbsDeviceVolumeType_GP3,
				Throughput: jsii.Number(125),
			}),
		},
	},
})

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.

throughputoptionalnumberthroughputoptionalint | floatthroughputoptionalNumberThroughputoptionaldoubleThroughputoptional*float64 #
The throughput that the volume supports, in MiB/s Takes a minimum of 125 and maximum of 2000.

Default: 125 MiB/s. Only valid on gp3 volumes.

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 = `EbsDeviceVolumeType.GP2` #
The EBS volume type.