BlockDeviceVolume
- class aws_cdk.aws_autoscaling.BlockDeviceVolume(ebs_device=None, virtual_name=None)
Bases:
object
Describes a block device mapping for an EC2 instance or Auto Scaling group.
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_autoscaling as autoscaling block_device_volume = autoscaling.BlockDeviceVolume.ebs(123, delete_on_termination=False, encrypted=False, iops=123, volume_type=autoscaling.EbsDeviceVolumeType.STANDARD )
- Parameters:
ebs_device (
Union
[EbsDeviceProps
,Dict
[str
,Any
],None
]) – EBS device info.virtual_name (
Optional
[str
]) – Virtual device name.
Attributes
- ebs_device
EBS device info.
- virtual_name
Virtual device name.
Static Methods
- classmethod ebs(volume_size, *, encrypted=None, delete_on_termination=None, iops=None, volume_type=None)
Creates a new Elastic Block Storage device.
- Parameters:
volume_size (
Union
[int
,float
]) – The volume size, in Gibibytes (GiB).encrypted (
Optional
[bool
]) – Specifies whether the EBS volume is encrypted. Encrypted EBS volumes can only be attached to instances that support Amazon EBS encryption Default: falsedelete_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 {@link volumeType}: {@link 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 {@link EbsDeviceVolumeType.IO1}volume_type (
Optional
[EbsDeviceVolumeType
]) – The EBS volume type. Default: {@link EbsDeviceVolumeType.GP2}
- Return type:
- classmethod ebs_from_snapshot(snapshot_id, *, volume_size=None, delete_on_termination=None, iops=None, volume_type=None)
Creates a new Elastic Block Storage device from an existing snapshot.
- Parameters:
snapshot_id (
str
) – The snapshot ID of the volume to use.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 sizedelete_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 {@link volumeType}: {@link 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 {@link EbsDeviceVolumeType.IO1}volume_type (
Optional
[EbsDeviceVolumeType
]) – The EBS volume type. Default: {@link EbsDeviceVolumeType.GP2}
- Return type:
- classmethod ephemeral(volume_index)
Creates a virtual, ephemeral device.
The name will be in the form ephemeral{volumeIndex}.
- Parameters:
volume_index (
Union
[int
,float
]) – the volume index. Must be equal or greater than 0- Return type:
- classmethod no_device()
Supresses a volume mapping.
- Return type: