cloudtools / troposphere

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

Remove storage size validation for gp3 RDS StorageType #2142

Closed dieutoutpuissant closed 1 year ago

dieutoutpuissant commented 1 year ago

update validator for gp3 storage type, which isn't based on Iops minimum allocated storage anymore

markpeek commented 1 year ago

Looking on the RDS DBInstance page under StorageType I see:

StorageType
Specifies the storage type to be associated with the DB instance.

Valid values: gp2 | gp3 | io1 | standard

The standard value is also known as magnetic.

If you specify io1 or gp3, you must also include a value for the Iops parameter.

Default: io1 if the Iops parameter is specified, otherwise gp2

So it seems there is still a requirement to specify Iops for gp3?

dieutoutpuissant commented 1 year ago

It is still a requirement to specify Iops for gp3, however the minimum allocated storage constraints don't apply to said storage type anymore according to the RDS Documentation: By using General Purpose SSD gp3 storage volumes, you can customize storage performance independently of storage capacity.

fpavageau commented 1 year ago

Actually, it seems it's even more complicated than that: the same RDS DBInstance page under Iops says

Note If you specify io1 for the StorageType property, then you must also specify the Iops property.

It could be seen as a oversight of the gp3 addition, but the RDS DB instance storage page under "gp3 storage" has "N/A" as the range of Provisioned IOPS when the storage size is less that 400 GiB for MariaDB, MySQL, and PostgreSQL (200 GiB for Oracle), so maybe it's not a hard requirement. Also, more practically, we tried to update an existing database with 100 GiB of storage from gp2 to gp3, specifying the baseline 3000 for Iops, and CloudFormation failed with the following error:

Resource handler returned message: "You can't specify IOPS or storage throughput for engine postgres and a storage size less than 400. (Service: Rds, Status Code: 400, Request ID: 12345678-1234-1234-1234-123456789012)" (RequestToken: 98765432-9876-9876-9876-987654321098, HandlerErrorCode: InvalidRequest)

It could be seen as a bug in CloudFormation, which could accept the baseline as the only valid value for small storage sizes instead of refusing it altogether, especially given that the threshold is different depending on the database engine.

markpeek commented 1 year ago

Thanks!