VolumeProps

class aws_cdk.aws_ec2.VolumeProps(*, availability_zone, auto_enable_io=None, enable_multi_attach=None, encrypted=None, encryption_key=None, iops=None, size=None, snapshot_id=None, volume_name=None, volume_type=None)

Bases: object

__init__(*, availability_zone, auto_enable_io=None, enable_multi_attach=None, encrypted=None, encryption_key=None, iops=None, size=None, snapshot_id=None, volume_name=None, volume_type=None)

Properties of an EBS Volume.

Parameters
  • availability_zone (str) – The Availability Zone in which to create the volume.

  • auto_enable_io (Optional[bool]) – Indicates whether the volume is auto-enabled for I/O operations. 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. Default: false

  • enable_multi_attach (Optional[bool]) – Indicates whether Amazon EBS Multi-Attach is enabled. See {@link https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volumes-multi.html#considerations|Considerations and limitations} for the constraints of multi-attach. Default: false

  • encrypted (Optional[bool]) – Specifies whether the volume should be encrypted. 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 {@link https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#encryption-by-default|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 {@link https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#EBSEncryption_supported_instances|Supported Instance Types.} Default: false

  • encryption_key (Optional[IKey]) – The customer-managed encryption key that is used to encrypt the Volume. The encrypted property must be true if this is provided. Note: If using an {@link aws-kms.IKey} created from a {@link 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: The default KMS key for the account, region, and EC2 service is used.

  • iops (Union[int, float, None]) – The number of I/O operations per second (IOPS) to provision for the volume, with a maximum ratio of 50 IOPS/GiB. See {@link https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volume-types.html#EBSVolumeTypes_piops|Provisioned IOPS SSD (io1) volumes} for more information. This parameter is valid only for PROVISIONED_IOPS_SSD volumes. Default: None – Required for {@link EbsDeviceVolumeType.PROVISIONED_IOPS_SSD}

  • size (Optional[Size]) – The size of the volume, in GiBs. You must specify either a snapshot ID or a volume size. See {@link https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volume-types.html#ebs-volume-characteristics|Volume Characteristics} for details on the allowable size for each type of volume. Default: If you’re creating the volume from a snapshot and don’t specify a volume size, the default is the snapshot size.

  • snapshot_id (Optional[str]) – The snapshot from which to create the volume. You must specify either a snapshot ID or a volume size. Default: The EBS volume is not created from a snapshot.

  • volume_name (Optional[str]) – The value of the physicalName property of this resource. Default: The physical name will be allocated by CloudFormation at deployment time

  • volume_type (Optional[EbsDeviceVolumeType]) – The type of the volume; what type of storage to use to form the EBS Volume. Default: {@link EbsDeviceVolumeType.GENERAL_PURPOSE_SSD}

Return type

None

Attributes

auto_enable_io

Indicates whether the volume is auto-enabled for I/O operations.

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.

default :default: false

Return type

Optional[bool]

availability_zone

The Availability Zone in which to create the volume.

Return type

str

enable_multi_attach

Indicates whether Amazon EBS Multi-Attach is enabled.

See {@link https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volumes-multi.html#considerations|Considerations and limitations} for the constraints of multi-attach.

default :default: false

Return type

Optional[bool]

encrypted

Specifies whether the volume should be encrypted.

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 {@link https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#encryption-by-default|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 {@link https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#EBSEncryption_supported_instances|Supported Instance Types.}

default :default: false

Return type

Optional[bool]

encryption_key

The customer-managed encryption key that is used to encrypt the Volume.

The encrypted property must be true if this is provided.

Note: If using an {@link aws-kms.IKey} created from a {@link 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 :default: The default KMS key for the account, region, and EC2 service is used.

Return type

Optional[IKey]

iops

The number of I/O operations per second (IOPS) to provision for the volume, with a maximum ratio of 50 IOPS/GiB.

See {@link https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volume-types.html#EBSVolumeTypes_piops|Provisioned IOPS SSD (io1) volumes} for more information.

This parameter is valid only for PROVISIONED_IOPS_SSD volumes.

default :default: None – Required for {@link EbsDeviceVolumeType.PROVISIONED_IOPS_SSD}

Return type

Union[int, float, None]

size

The size of the volume, in GiBs.

You must specify either a snapshot ID or a volume size. See {@link https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volume-types.html#ebs-volume-characteristics|Volume Characteristics} for details on the allowable size for each type of volume.

default :default: If you’re creating the volume from a snapshot and don’t specify a volume size, the default is the snapshot size.

Return type

Optional[Size]

snapshot_id

The snapshot from which to create the volume.

You must specify either a snapshot ID or a volume size.

default :default: The EBS volume is not created from a snapshot.

Return type

Optional[str]

volume_name

The value of the physicalName property of this resource.

default :default: The physical name will be allocated by CloudFormation at deployment time

Return type

Optional[str]

volume_type

The type of the volume;

what type of storage to use to form the EBS Volume.

default :default: {@link EbsDeviceVolumeType.GENERAL_PURPOSE_SSD}

Return type

Optional[EbsDeviceVolumeType]