Skip to content

Comments

fix(ec2): allow EBS gp3 and io2 volumes up to 64 TiB#37049

Open
aayushostwal wants to merge 1 commit intoaws:mainfrom
aayushostwal:fix/ebs-volume-max-size-gp3-io2
Open

fix(ec2): allow EBS gp3 and io2 volumes up to 64 TiB#37049
aayushostwal wants to merge 1 commit intoaws:mainfrom
aayushostwal:fix/ebs-volume-max-size-gp3-io2

Conversation

@aayushostwal
Copy link

Issue # (if applicable)

Closes #37045.

Reason for this change

EBS volume size limits in AWS have been updated: io2 supports 4 GiB–64 TiB and gp3 supports 1 GiB–64 TiB (EBS volume types; gp3 limit increased Sept 2025). The CDK was still enforcing a 16 TiB (16384 GiB) maximum for both, causing validation errors when creating io2 or gp3 volumes larger than 16 TiB (e.g. Size.gibibytes(25000)). This change aligns CDK validation with current AWS limits.

Description of changes

  • packages/aws-cdk-lib/aws-ec2/lib/volume.ts
    Raised max size for GENERAL_PURPOSE_SSD_GP3 (gp3) and PROVISIONED_IOPS_SSD_IO2 (io2) from 16384 GiB to 65536 GiB (64 TiB). Left gp2, io1, st1, sc1, and magnetic limits unchanged per current AWS docs.

  • packages/aws-cdk-lib/aws-ecs/lib/base/service-managed-volume.ts
    Applied the same gp3 and io2 max size (65536 GiB) for ECS Service Managed EBS volumes so behavior matches the EC2 Volume construct.

  • packages/aws-cdk-lib/aws-ec2/test/volume.test.ts
    Updated the “validation size in range” test data so the expected max for gp3 and io2 is 65536 instead of 16384.

No API or behavior changes for other volume types; only validation bounds were updated. Alternatives considered: updating all volume types to 64 TiB was rejected because AWS still documents 16 TiB max for gp2, io1, st1, and sc1.

Describe any new or updated permissions being added

None. This change only adjusts client-side validation limits; it does not introduce or change any IAM or resource permissions.

Description of how you validated changes

  • Unit tests: Updated and ran the existing EC2 volume size validation tests in packages/aws-cdk-lib/aws-ec2/test/volume.test.ts (including “validation size in range”). Tests confirm that min/max (e.g. 1/65536 for gp3, 4/65536 for io2) are accepted and values outside the range are rejected.
  • Build: Verified aws-cdk-lib build and relevant tests pass (e.g. yarn test aws-ec2).
  • No new integration tests were added; this is a validation-only change that does not affect deployment or CloudFormation resource creation beyond allowing previously rejected sizes that AWS already supports.

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@github-actions github-actions bot added bug This issue is a bug. p2 beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK labels Feb 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK bug This issue is a bug. p2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ec2]: fix ebs io2 and gp3 size limit

1 participant