# EbsDeviceOptions

Block device options for an EBS volume.

Extends: EbsDeviceOptions
Extends: EbsDeviceOptionsBase

- Source: [`aws-autoscaling/lib/volume.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-autoscaling/lib/volume.ts#L98)

## 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,
        }),
      },
  ],
  // ...
});
```

## Properties

- `deleteOnTermination`: boolean — Indicates whether to delete the volume when the instance is terminated.

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

- `encrypted`: boolean = false — Specifies whether the EBS volume is encrypted.

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

- `iops`: number — 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.

- `throughput`: number — 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.

- `volumeInitializationRate`: [Size](/cdk/api/v2/docs/aws-cdk-lib.Size.html) — 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.

- `volumeType`: [EbsDeviceVolumeType](/cdk/api/v2/docs/aws-cdk-lib.aws_autoscaling.EbsDeviceVolumeType.html) = `EbsDeviceVolumeType.GP2` — The EBS volume type.
