Stop letting CloudFormation pick gp2 type for your EBS volumes
Old default that costs you money (and performance)
In 2020, AWS launched a new, gp3 EBS volume type. It was marketed as a clear no-brainer switch - cheaper, better baseline performance than previous gp2 type. Five years later, it should be a default choice when starting out with an EBS volume. But for CloudFormation, it unfortunately still isn't.
If you look at the AWS::EC2::Volume docs, the default VolumeType is still the good old gp2.
MyVolume:
Type: AWS::EC2::Volume
Properties:
Size: 100
AvailabilityZone: us-east-1a
# implicitly creates a gp2 volumeThe fix is a single line. Make sure your templates (and any older modules you've copy-pasted or llm-ed into existence) explicitly set VolumeType: gp3:
MyVolume:
Type: AWS::EC2::Volume
Properties:
Size: 100
VolumeType: gp3
AvailabilityZone: us-east-1aThe same gotcha applies to block device mappings on EC2 instances, launch templates, and AMI definitions, basiclly anywhere CloudFormation creates an EBS volume on your behalf, the default falls back to gp2.
Note: For existing volumes, aws ec2 modify-volume --volume-type gp3 --volume-id vol-xxx should do the trick. For more details regarding migration, I recommend referring to this doc. Thanks for reading!