VolumeProps Struct
Properties of an EBS Volume.
Example
new ec2.Volume(this, 'Volume', {
availabilityZone: 'us-east-1a',
size: Size.gibibytes(125),
volumeType: ec2.EbsDeviceVolumeType.GP3,
throughput: 125,
});
Properties
notes
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.
availabilityZonestringavailability_zonestravailabilityZoneStringAvailabilityZonestringAvailabilityZone*stringrequired#enableMultiAttachbooleanenable_multi_attachboolenableMultiAttachBooleanEnableMultiAttachboolEnableMultiAttach*bool= false#See Considerations and limitations for the constraints of multi-attach.
notes
The effect of setting the encryption state to true depends on the volume origin (new or from a snapshot), starting encryption state, ownership, and whether encryption by default is enabled. For more information, see Encryption by Default in the Amazon Elastic Compute Cloud User Guide.
Encrypted Amazon EBS volumes must be attached to instances that support Amazon EBS encryption. For more information, see Supported Instance Types.
Default: The default KMS key for the account, region, and EC2 service is used.
notes
The encrypted property must be true if this is provided.
Note: If using an aws-kms.IKey created from a aws-kms.Key.fromKeyArn() here, then the KMS key must have the following in its Key policy; otherwise, the Volume will fail to create.
{
"Effect": "Allow",
"Principal": { "AWS": "<arn for your account-user> ex: arn:aws:iam::00000000000:root" },
"Resource": "*",
"Action": [
"kms:DescribeKey",
"kms:GenerateDataKeyWithoutPlainText",
],
"Condition": {
"StringEquals": {
"kms:ViaService": "ec2.<Region>.amazonaws.com", (eg: ec2.us-east-1.amazonaws.com)
"kms:CallerAccount": "0000000000" (your account ID)
}
}
}
Default: None -- Required for io1 and io2 volumes. The default for gp3 volumes is 3,000 IOPS if omitted.
notes
The maximum ratio is 50 IOPS/GiB for PROVISIONED_IOPS_SSD, and 500 IOPS/GiB for both PROVISIONED_IOPS_SSD_IO2 and GENERAL_PURPOSE_SSD_GP3. See https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-volume.html for more information.
This parameter is valid only for PROVISIONED_IOPS_SSD, PROVISIONED_IOPS_SSD_IO2 and GENERAL_PURPOSE_SSD_GP3 volumes.
removalPolicyRemovalPolicyremoval_policyRemovalPolicyremovalPolicyRemovalPolicyRemovalPolicyRemovalPolicyRemovalPolicyRemovalPolicy= RemovalPolicy.RETAIN#Default: If you're creating the volume from a snapshot and don't specify a volume size, the default is the snapshot size.
You must specify either a snapshot ID or a volume size. See https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-volume.html for details on the allowable size for each type of volume.
Default: The EBS volume is not created from a snapshot.
You must specify either a snapshot ID or a volume size.
Default: 125 MiB/s. Only valid on gp3 volumes.
volumeInitializationRateSizevolume_initialization_rateSizevolumeInitializationRateSizeVolumeInitializationRateSizeVolumeInitializationRateSize#Default: undefined - The volume initialization rate is not set.
Valid range is between 100 and 300 MiB/s.
This parameter is supported only for volumes created from snapshots.
Default: The physical name will be allocated by CloudFormation at deployment time
volumeTypeEbsDeviceVolumeTypevolume_typeEbsDeviceVolumeTypevolumeTypeEbsDeviceVolumeTypeVolumeTypeEbsDeviceVolumeTypeVolumeTypeEbsDeviceVolumeType#Default: EbsDeviceVolumeType.GENERAL_PURPOSE_SSD
what type of storage to use to form the EBS Volume.