Class EbsDeviceProps
Properties of an EBS block device.
Inheritance
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class EbsDeviceProps : Object, IEbsDeviceProps, IEbsDeviceSnapshotOptions, IEbsDeviceOptions, IEbsDeviceOptionsBase
Syntax (vb)
Public Class EbsDeviceProps
Inherits Object
Implements IEbsDeviceProps, IEbsDeviceSnapshotOptions, IEbsDeviceOptions, IEbsDeviceOptionsBase
Remarks
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.EC2;
using Amazon.CDK.AWS.KMS;
Key key;
var ebsDeviceProps = new EbsDeviceProps {
DeleteOnTermination = false,
Encrypted = false,
Iops = 123,
KmsKey = key,
SnapshotId = "snapshotId",
Throughput = 123,
VolumeSize = 123,
VolumeType = EbsDeviceVolumeType.STANDARD
};
Synopsis
Constructors
EbsDeviceProps() |
Properties
DeleteOnTermination | Indicates whether to delete the volume when the instance is terminated. |
Encrypted | Specifies whether the EBS volume is encrypted. |
Iops | The number of I/O operations per second (IOPS) to provision for the volume. |
KmsKey | The ARN of the AWS Key Management Service (AWS KMS) CMK used for encryption. |
SnapshotId | The snapshot ID of the volume to use. |
Throughput | The throughput to provision for a |
VolumeSize | The volume size, in Gibibytes (GiB). |
VolumeType | The EBS volume type. |
Constructors
EbsDeviceProps()
public EbsDeviceProps()
Properties
DeleteOnTermination
Indicates whether to delete the volume when the instance is terminated.
public Nullable<bool> DeleteOnTermination { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: - true for Amazon EC2 Auto Scaling, false otherwise (e.g. EBS)
Encrypted
Specifies whether the EBS volume is encrypted.
public Nullable<bool> Encrypted { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Encrypted EBS volumes can only be attached to instances that support Amazon EBS encryption
Default: false
Iops
The number of I/O operations per second (IOPS) to provision for the volume.
public Nullable<double> Iops { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
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
KmsKey
The ARN of the AWS Key Management Service (AWS KMS) CMK used for encryption.
public IKey KmsKey { get; set; }
Property Value
Remarks
You have to ensure that the KMS CMK has the correct permissions to be used by the service launching the ec2 instances.
Default: - If encrypted is true, the default aws/ebs KMS key will be used.
See: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#ebs-encryption-requirements
SnapshotId
The snapshot ID of the volume to use.
public string SnapshotId { get; set; }
Property Value
System.String
Remarks
Default: - No snapshot will be used
Throughput
The throughput to provision for a gp3
volume.
public Nullable<double> Throughput { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
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.
Default: - 125 MiB/s.
See: https://docs.aws.amazon.com/ebs/latest/userguide/general-purpose.html#gp3-performance
VolumeSize
The volume size, in Gibibytes (GiB).
public Nullable<double> VolumeSize { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
If you specify volumeSize, it must be equal or greater than the size of the snapshot.
Default: - The snapshot size
VolumeType
The EBS volume type.
public Nullable<EbsDeviceVolumeType> VolumeType { get; set; }
Property Value
System.Nullable<EbsDeviceVolumeType>
Remarks
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