perfectsense / gyro-aws-provider

AWS Provider for Gyro cloud automation tool.
https://gyro.dev/providers/aws/
Apache License 2.0
8 stars 1 forks source link

Fixed validation of read and write capacities #641

Closed aftenkap closed 7 months ago

aftenkap commented 7 months ago

resolves #642

Currently, the validation only checks for null values in the readCapacity and writeCapacity fields (both for PROVISIONED and PAY_PER_REQUEST billing modes).

However, a DescribeTableRequest will return a 0 (zero) value for both readCapacity and writeCapacity, which will fail the validation of a PAY_PER_REQUEST table.

Furthermore, a 0 (zero) value for readCapacity and writeCapacity will pass validation, whereas those values are below the minimum required values for a PROVISIONED table (see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ServiceQuotas.html#default-limits-throughput-capacity-modes).

This PR updates the checks to validate a non-zero, positive value for PROVISIONED tables and a null or smaller or equal to zero value for PAY_PER_REQUEST tables.