Class EbsDeviceOptions
Block device options for an EBS volume.
Inheritance
Namespace: Amazon.CDK.AWS.AutoScaling
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class EbsDeviceOptions : Object, IEbsDeviceOptions, IEbsDeviceOptionsBase
Syntax (vb)
Public Class EbsDeviceOptions
Inherits Object
Implements IEbsDeviceOptions, IEbsDeviceOptionsBase
Remarks
ExampleMetadata: infused
Examples
Vpc vpc;
InstanceType instanceType;
IMachineImage machineImage;
var autoScalingGroup = new AutoScalingGroup(this, "ASG", new AutoScalingGroupProps {
Vpc = vpc,
InstanceType = instanceType,
MachineImage = machineImage,
BlockDevices = new [] { new BlockDevice {
DeviceName = "gp3-volume",
Volume = BlockDeviceVolume.Ebs(15, new EbsDeviceOptions {
VolumeType = EbsDeviceVolumeType.GP3,
Throughput = 125
})
} }
});
Synopsis
Constructors
EbsDeviceOptions() |
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. |
Throughput | The throughput that the volume supports, in MiB/s Takes a minimum of 125 and maximum of 1000. |
VolumeType | The EBS volume type. |
Constructors
EbsDeviceOptions()
public EbsDeviceOptions()
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
Throughput
The throughput that the volume supports, in MiB/s Takes a minimum of 125 and maximum of 1000.
public Nullable<double> Throughput { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
Default: - 125 MiB/s. Only valid on gp3 volumes.
See: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html
VolumeType
The EBS volume type.
public Nullable<EbsDeviceVolumeType> VolumeType { get; set; }
Property Value
System.Nullable<EbsDeviceVolumeType>
Remarks
Default: EbsDeviceVolumeType.GP2
See: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html