# EbsDeviceSnapshotOptions

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

Extends: [EbsDeviceOptionsBase](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_autoscaling.EbsDeviceOptionsBase.html)
Used as argument in: [BlockDeviceVolume.ebsFromSnapshot](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_autoscaling.BlockDeviceVolume.html#ebsfromsnapshot)

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

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_autoscaling as autoscaling } from 'aws-cdk-lib';

declare const size: cdk.Size;
const ebsDeviceSnapshotOptions: autoscaling.EbsDeviceSnapshotOptions = {
  deleteOnTermination: false,
  iops: 123,
  throughput: 123,
  volumeInitializationRate: size,
  volumeSize: 123,
  volumeType: autoscaling.EbsDeviceVolumeType.STANDARD,
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk as cdk
from aws_cdk import aws_autoscaling as autoscaling

# size: cdk.Size

ebs_device_snapshot_options = autoscaling.EbsDeviceSnapshotOptions(
    delete_on_termination=False,
    iops=123,
    throughput=123,
    volume_initialization_rate=size,
    volume_size=123,
    volume_type=autoscaling.EbsDeviceVolumeType.STANDARD
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;
import software.amazon.awscdk.services.autoscaling.*;

Size size;

EbsDeviceSnapshotOptions ebsDeviceSnapshotOptions = EbsDeviceSnapshotOptions.builder()
        .deleteOnTermination(false)
        .iops(123)
        .throughput(123)
        .volumeInitializationRate(size)
        .volumeSize(123)
        .volumeType(EbsDeviceVolumeType.STANDARD)
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;
using Amazon.CDK.AWS.AutoScaling;

Size size;

var ebsDeviceSnapshotOptions = new EbsDeviceSnapshotOptions {
    DeleteOnTermination = false,
    Iops = 123,
    Throughput = 123,
    VolumeInitializationRate = size,
    VolumeSize = 123,
    VolumeType = EbsDeviceVolumeType.STANDARD
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import cdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var size Size

ebsDeviceSnapshotOptions := &EbsDeviceSnapshotOptions{
	DeleteOnTermination: jsii.Boolean(false),
	Iops: jsii.Number(123),
	Throughput: jsii.Number(123),
	VolumeInitializationRate: size,
	VolumeSize: jsii.Number(123),
	VolumeType: awscdk.Aws_autoscaling.EbsDeviceVolumeType_STANDARD,
}
```

## 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 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](https://docs.aws.amazon.com/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](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_autoscaling.EbsDeviceVolumeType.html) = `EbsDeviceVolumeType.GP2` — The EBS volume type.
