fix(cloudformation): refuse a provisioned DynamoDB table without capacity (#9126)

* fix(cloudformation): refuse a provisioned DynamoDB table without capacity
* chore(cloudformation): share the on-demand createTable test matcher
This commit is contained in:
TATSUNO “Taz” Yasuhiro authored and GitHub committed 2026-11-20 23:15:25 -04:00
1 parent a87e8e47e0
commit d22ea96ecf
9 files changed
+225 -80

No files matched your search

@@ -282,6 +282,10 @@ public class DynamoDbCfnProvisioner implements CfnResourceProvisioner {
throw new AwsException("InvalidRequest",
"Property ProvisionedThroughput can't be used with PAY_PER_REQUEST BillingMode.", 400);
}
if (plainTable && !onDemand && (tableThroughput.capacity() == null
|| indexThroughput.values().stream().anyMatch(spec -> spec.capacity() == null))) {
throw new AwsException("InvalidRequest", "Property ProvisionedThroughput cannot be empty", 400);
}
boolean throughputDeclared = isDeclared(tableThroughput) || indexThroughput.values().stream()
.anyMatch(DynamoDbCfnProvisioner::isDeclared);
TableDefinition table;