interface EbsDeviceProps
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.EC2.EbsDeviceProps |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsec2#EbsDeviceProps |
Java | software.amazon.awscdk.services.ec2.EbsDeviceProps |
Python | aws_cdk.aws_ec2.EbsDeviceProps |
TypeScript (source) | aws-cdk-lib » aws_ec2 » EbsDeviceProps |
Properties of an EBS block device.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
import { aws_kms as kms } from 'aws-cdk-lib';
declare const key: kms.Key;
const ebsDeviceProps: ec2.EbsDeviceProps = {
deleteOnTermination: false,
encrypted: false,
iops: 123,
kmsKey: key,
snapshotId: 'snapshotId',
throughput: 123,
volumeSize: 123,
volumeType: ec2.EbsDeviceVolumeType.STANDARD,
};
Properties
Name | Type | Description |
---|---|---|
delete | boolean | Indicates whether to delete the volume when the instance is terminated. |
encrypted? | boolean | Specifies whether the EBS volume is encrypted. |
iops? | number | The number of I/O operations per second (IOPS) to provision for the volume. |
kms | IKey | The ARN of the AWS Key Management Service (AWS KMS) CMK used for encryption. |
snapshot | string | The snapshot ID of the volume to use. |
throughput? | number | The throughput to provision for a gp3 volume. |
volume | number | The volume size, in Gibibytes (GiB). |
volume | Ebs | The EBS volume type. |
deleteOnTermination?
Type:
boolean
(optional, default: true for Amazon EC2 Auto Scaling, false otherwise (e.g. EBS))
Indicates whether to delete the volume when the instance is terminated.
encrypted?
Type:
boolean
(optional, default: false)
Specifies whether the EBS volume is encrypted.
Encrypted EBS volumes can only be attached to instances that support Amazon EBS encryption
iops?
Type:
number
(optional, default: none, required for EbsDeviceVolumeType.IO1
)
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.
See also: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html
kmsKey?
Type:
IKey
(optional, default: If encrypted is true, the default aws/ebs KMS key will be used.)
The ARN of the AWS Key Management Service (AWS KMS) CMK used for encryption.
You have to ensure that the KMS CMK has the correct permissions to be used by the service launching the ec2 instances.
See also: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#ebs-encryption-requirements
snapshotId?
Type:
string
(optional, default: No snapshot will be used)
The snapshot ID of the volume to use.
throughput?
Type:
number
(optional, default: 125 MiB/s.)
The throughput to provision for a gp3
volume.
Valid Range: Minimum value of 125. Maximum value of 1000.
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.
See also: https://docs.aws.amazon.com/ebs/latest/userguide/general-purpose.html#gp3-performance
volumeSize?
Type:
number
(optional, default: The snapshot size)
The volume size, in Gibibytes (GiB).
If you specify volumeSize, it must be equal or greater than the size of the snapshot.
volumeType?
Type:
Ebs
(optional, default: EbsDeviceVolumeType.GENERAL_PURPOSE_SSD
or EbsDeviceVolumeType.GENERAL_PURPOSE_SSD_GP3
if
@aws-cdk/aws-ec2:ebsDefaultGp3Volume
is enabled.)
The EBS volume type.
See also: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html