cloudtools / troposphere

troposphere - Python library to create AWS CloudFormation descriptions
BSD 2-Clause "Simplified" License
4.93k stars 1.45k forks source link

RDS gp3 disk with storage size < 100 #2141

Closed LorenzoPintore closed 1 year ago

LorenzoPintore commented 1 year ago

Hi, I'm trying to create an RDS with gp3 disk and storage size < 100 (e.g. 20). This is a valid storage size for gp3 disk, accordingly to AWS (I've tried manually on AWS console).

I think there is a bug in the RDS validator class, specifically in the "validate_dbinstance" function:
it returns "AllocatedStorage must be at least 100 when Iops is set", stating that 100GB is the minimum value when IOPS are set. This is no more true since gp3 disks are available. I've set IOPS value to 3000, which is the default (and the only acceptable) value for IOPS if allocated storage is < 400 GB.

Thanks, Lorenzo

LorenzoPintore commented 1 year ago

The issue was a mistake: you have to set IOPS and Throughput to "Ref(AWS_NO_VALUE)" if allocated storage size is < 400, otherwise the cloudformation will fail with the following message: "You can't specify IOPS or storage throughput for engine postgres and a storage size less than 400. " Thus it is impossible to set IOPS if storage size < 400 (and thus even if storage size < 100)