EbsDeviceSnapshotOptions

class aws_cdk.aws_ec2.EbsDeviceSnapshotOptions(*, delete_on_termination=None, iops=None, throughput=None, volume_initialization_rate=None, volume_type=None, volume_size=None)

Bases: EbsDeviceOptionsBase

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

Parameters:
  • delete_on_termination (Optional[bool]) – Indicates whether to delete the volume when the instance is terminated. Default: - true for Amazon EC2 Auto Scaling, false otherwise (e.g. EBS)

  • iops (Union[int, float, None]) – 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. Default: - none, required for EbsDeviceVolumeType.IO1

  • throughput (Union[int, float, None]) – The throughput to provision for a gp3 volume. 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. Default: - 125 MiB/s.

  • volume_initialization_rate (Optional[Size]) – The Amazon EBS Provisioned Rate for Volume Initialization, at which to download the snapshot blocks from Amazon S3 to the volume. Valid range is between 100 and 300 MiB/s. This parameter is supported only for volumes created from snapshots. Default: undefined - The volume initialization rate is not set.

  • volume_type (Optional[EbsDeviceVolumeType]) – The EBS volume type. Default: EbsDeviceVolumeType.GENERAL_PURPOSE_SSD or EbsDeviceVolumeType.GENERAL_PURPOSE_SSD_GP3 if @aws-cdk/aws-ec2:ebsDefaultGp3Volume is enabled.

  • volume_size (Union[int, float, None]) – The volume size, in Gibibytes (GiB). If you specify volumeSize, it must be equal or greater than the size of the snapshot. Default: - The snapshot size

ExampleMetadata:

infused

Example:

launch_template = ec2.LaunchTemplate(self, "LaunchTemplate",
    block_devices=[ec2.BlockDevice(
        device_name="deviceName",
        volume=ec2.BlockDeviceVolume.ebs_from_snapshot("snap-1234567890abcdef0",
            volume_size=150,
            volume_initialization_rate=Size.mebibytes(200)
        )
    )
    ]
)

Attributes

delete_on_termination

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

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

iops

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.

Default:
  • none, required for EbsDeviceVolumeType.IO1

See:

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

throughput

The throughput to provision for a gp3 volume.

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.

Default:
  • 125 MiB/s.

See:

https://docs.aws.amazon.com/ebs/latest/userguide/general-purpose.html#gp3-performance

volume_initialization_rate

The Amazon EBS Provisioned Rate for Volume Initialization, at which to download the snapshot blocks from Amazon S3 to the volume.

Valid range is between 100 and 300 MiB/s. This parameter is supported only for volumes created from snapshots.

Default:

undefined - The volume initialization rate is not set.

See:

https://docs.aws.amazon.com/ebs/latest/userguide/initalize-volume.html#volume-initialization-rate

volume_size

The volume size, in Gibibytes (GiB).

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

Default:
  • The snapshot size

volume_type

The EBS volume type.

Default:

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

See:

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