# EbsDeviceSnapshotOptions

Block device options for an EBS volume created from a snapshot.

Extends: EbsDeviceSnapshotOptions
Extends: EbsDeviceOptionsBase

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

## Example

```ts
const launchTemplate = new ec2.LaunchTemplate(this, 'LaunchTemplate', {
  blockDevices: [
    {
      deviceName: 'deviceName',
      volume: ec2.BlockDeviceVolume.ebsFromSnapshot('snap-1234567890abcdef0', {
        volumeSize: 150,
        volumeInitializationRate: Size.mebibytes(200),
      }),
    },
  ],
});
```

## 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)

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

  **Default:** 125 MiB/s.

  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.

- `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.

- `volumeSize`: number — The volume size, in Gibibytes (GiB).

  **Default:** The snapshot size

  If you specify volumeSize, it must be equal or greater than the size of the snapshot.

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

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