Interface ICfnVolumeProps
Properties for defining a CfnVolume.
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface ICfnVolumeProps
Syntax (vb)
Public Interface ICfnVolumeProps
Remarks
See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-volume.html
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;
var cfnVolumeProps = new CfnVolumeProps {
AutoEnableIo = false,
AvailabilityZone = "availabilityZone",
AvailabilityZoneId = "availabilityZoneId",
Encrypted = false,
Iops = 123,
KmsKeyId = "kmsKeyId",
MultiAttachEnabled = false,
OutpostArn = "outpostArn",
Size = 123,
SnapshotId = "snapshotId",
SourceVolumeId = "sourceVolumeId",
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} },
Throughput = 123,
VolumeInitializationRate = 123,
VolumeType = "volumeType"
};
Synopsis
Properties
| AutoEnableIo | Indicates whether the volume is auto-enabled for I/O operations. |
| AvailabilityZone | The ID of the Availability Zone in which to create the volume. For example, |
| AvailabilityZoneId | The ID of the Availability Zone in which to create the volume. For example, |
| Encrypted | Indicates whether the volume should be encrypted. |
| Iops | The number of I/O operations per second (IOPS) to provision for the volume. |
| KmsKeyId | The identifier of the AWS KMS key to use for Amazon EBS encryption. |
| MultiAttachEnabled | Indicates whether Amazon EBS Multi-Attach is enabled. |
| OutpostArn | The Amazon Resource Name (ARN) of the Outpost on which to create the volume. |
| Size | The size of the volume, in GiBs. |
| SnapshotId | The snapshot from which to create the volume. |
| SourceVolumeId | The ID of the source EBS volume to copy. |
| Tags | The tags to apply to the volume during creation. |
| Throughput | The throughput to provision for a volume, with a maximum of 1,000 MiB/s. |
| VolumeInitializationRate | Specifies the Amazon EBS Provisioned Rate for Volume Initialization (volume initialization rate), in MiB/s, at which to download the snapshot blocks from Amazon S3 to the volume. |
| VolumeType | The volume type. This parameter can be one of the following values:. |
Properties
AutoEnableIo
Indicates whether the volume is auto-enabled for I/O operations.
object? AutoEnableIo { get; }
Property Value
Remarks
By default, Amazon EBS disables I/O to the volume from attached EC2 instances when it determines that a volume's data is potentially inconsistent. If the consistency of the volume is not a concern, and you prefer that the volume be made available immediately if it's impaired, you can configure the volume to automatically enable I/O.
Type union: either bool or IResolvable
AvailabilityZone
The ID of the Availability Zone in which to create the volume. For example, us-east-1a .
string? AvailabilityZone { get; }
Property Value
Remarks
Either AvailabilityZone or AvailabilityZoneId must be specified, but not both.
If you are creating a volume copy, omit this parameter. The volume copy is created in the same Availability Zone as the source volume.
AvailabilityZoneId
The ID of the Availability Zone in which to create the volume. For example, use1-az1 .
string? AvailabilityZoneId { get; }
Property Value
Remarks
Either AvailabilityZone or AvailabilityZoneId must be specified, but not both.
If you are creating a volume copy, omit this parameter. The volume copy is created in the same Availability Zone as the source volume.
Encrypted
Indicates whether the volume should be encrypted.
object? Encrypted { get; }
Property Value
Remarks
The effect of setting the encryption state to true depends on the volume origin (new, from a snapshot, or from an existing volume), starting encryption state, ownership, and whether encryption by default is enabled. For more information, see Encryption by default in the Amazon EBS User Guide .
If you are creating a volume copy, omit this parameter. The volume is automatically encrypted with the same KMS key as the source volume. You can't copy unencrypted volumes.
Type union: either bool or IResolvable
Iops
The number of I/O operations per second (IOPS) to provision for the volume.
double? Iops { get; }
Property Value
Remarks
Required for io1 and io2 volumes. Optional for gp3 volumes. Omit for all other volume types.
Valid ranges:
<a href="https://docs.aws.amazon.com/ec2/latest/instancetypes/ec2-nitro-instances.html">Instances built on the Nitro System</a> can support up to 256,000 IOPS. Other instances can support up to 32,000 IOPS.
KmsKeyId
The identifier of the AWS KMS key to use for Amazon EBS encryption.
string? KmsKeyId { get; }
Property Value
Remarks
If KmsKeyId is specified, the encrypted state must be true .
If you omit this property and your account is enabled for encryption by default, or Encrypted is set to true , then the volume is encrypted using the default key specified for your account. If your account does not have a default key, then the volume is encrypted using the AWS managed key .
Alternatively, if you want to specify a different key, you can specify one of the following:
If you are creating a volume copy, omit this parameter. The volume is automatically encrypted with the same KMS key as the source volume. You can't copy unencrypted volumes.
MultiAttachEnabled
Indicates whether Amazon EBS Multi-Attach is enabled.
object? MultiAttachEnabled { get; }
Property Value
Remarks
AWS CloudFormation does not currently support updating a single-attach volume to be multi-attach enabled, updating a multi-attach enabled volume to be single-attach, or updating the size or number of I/O operations per second (IOPS) of a multi-attach enabled volume.
Type union: either bool or IResolvable
OutpostArn
The Amazon Resource Name (ARN) of the Outpost on which to create the volume.
string? OutpostArn { get; }
Property Value
Remarks
If you intend to use a volume with an instance running on an outpost, then you must create the volume on the same outpost as the instance. You can't use a volume created in an AWS Region with an instance on an AWS outpost, or the other way around.
Size
The size of the volume, in GiBs.
double? Size { get; }
Property Value
Remarks
Supported volume sizes:
SnapshotId
The snapshot from which to create the volume.
string? SnapshotId { get; }
Property Value
Remarks
Only specify to create a volume from a snapshot. To create a new empty volume, omit this parameter and specify a value for Size instead. To create a volume copy, omit this parameter and specify SourceVolumeId instead.
SourceVolumeId
The ID of the source EBS volume to copy.
string? SourceVolumeId { get; }
Property Value
Remarks
When specified, the volume is created as an exact copy of the specified volume. Only specify to create a volume copy. To create a new empty volume or to create a volume from a snapshot, omit this parameter,
Tags
The tags to apply to the volume during creation.
ICfnTag[]? Tags { get; }
Property Value
ICfnTag[]
Remarks
Throughput
The throughput to provision for a volume, with a maximum of 1,000 MiB/s.
double? Throughput { get; }
Property Value
Remarks
This parameter is valid only for gp3 volumes. The default value is 125.
Valid Range: Minimum value of 125. Maximum value of 1000.
VolumeInitializationRate
Specifies the Amazon EBS Provisioned Rate for Volume Initialization (volume initialization rate), in MiB/s, at which to download the snapshot blocks from Amazon S3 to the volume.
double? VolumeInitializationRate { get; }
Property Value
Remarks
This is also known as volume initialization . Specifying a volume initialization rate ensures that the volume is initialized at a predictable and consistent rate after creation.
This parameter is supported only for volumes created from snapshots. Omit this parameter if:
If you specify a snapshot that is enabled for fast snapshot restore and a volume initialization rate, the volume will be initialized at the specified rate instead of fast snapshot restore.
For more information, see Initialize Amazon EBS volumes in the Amazon EC2 User Guide .
Valid range: 100 - 300 MiB/s
VolumeType
The volume type. This parameter can be one of the following values:.
string? VolumeType { get; }
Property Value
Remarks
Throughput Optimized HDD ( <code>st1</code> ) and Cold HDD ( <code>sc1</code> ) volumes can't be used as boot volumes.
For more information, see Amazon EBS volume types in the Amazon EBS User Guide .
Default: gp2