Show / Hide Table of Contents

Class EbsDeviceOptions

Block device options for an EBS volume.

Inheritance
object
EbsDeviceOptions
Implements
IEbsDeviceOptions
IEbsDeviceOptionsBase
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class EbsDeviceOptions : IEbsDeviceOptions, IEbsDeviceOptionsBase
Syntax (vb)
Public Class EbsDeviceOptions Implements IEbsDeviceOptions, IEbsDeviceOptionsBase
Remarks

ExampleMetadata: infused

Examples
Vpc vpc;
            InstanceType instanceType;
            IMachineImage machineImage;


            new Instance(this, "Instance", new InstanceProps {
                Vpc = vpc,
                InstanceType = instanceType,
                MachineImage = machineImage,

                // ...

                BlockDevices = new [] { new BlockDevice {
                    DeviceName = "/dev/sda1",
                    Volume = BlockDeviceVolume.Ebs(100, new EbsDeviceOptions {
                        VolumeType = EbsDeviceVolumeType.GP3,
                        Throughput = 250
                    })
                } }
            });

Synopsis

Constructors

EbsDeviceOptions()

Block device options for an EBS volume.

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.

Throughput

The throughput to provision for a gp3 volume.

VolumeType

The EBS volume type.

Constructors

EbsDeviceOptions()

Block device options for an EBS volume.

public EbsDeviceOptions()
Remarks

ExampleMetadata: infused

Examples
Vpc vpc;
            InstanceType instanceType;
            IMachineImage machineImage;


            new Instance(this, "Instance", new InstanceProps {
                Vpc = vpc,
                InstanceType = instanceType,
                MachineImage = machineImage,

                // ...

                BlockDevices = new [] { new BlockDevice {
                    DeviceName = "/dev/sda1",
                    Volume = BlockDeviceVolume.Ebs(100, new EbsDeviceOptions {
                        VolumeType = EbsDeviceVolumeType.GP3,
                        Throughput = 250
                    })
                } }
            });

Properties

DeleteOnTermination

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

public bool? DeleteOnTermination { get; set; }
Property Value

bool?

Remarks

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

Encrypted

Specifies whether the EBS volume is encrypted.

public bool? Encrypted { get; set; }
Property Value

bool?

Remarks

Encrypted EBS volumes can only be attached to instances that support Amazon EBS encryption

Default: false

See: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#EBSEncryption_supported_instances

Iops

The number of I/O operations per second (IOPS) to provision for the volume.

public double? Iops { get; set; }
Property Value

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

IKey

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

Throughput

The throughput to provision for a gp3 volume.

public double? Throughput { get; set; }
Property Value

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

VolumeType

The EBS volume type.

public EbsDeviceVolumeType? VolumeType { get; set; }
Property Value

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

Implements

IEbsDeviceOptions
IEbsDeviceOptionsBase
Back to top Generated by DocFX