fix(cloudformation): reject a non-numeric AuthorizerResultTtlInSeconds (#4055)

ApiGatewayV2CfnProvisioner parsed AuthorizerResultTtlInSeconds with Integer.parseInt and let a non-numeric value throw a raw NumberFormatException (carried over as-is during the monolith extraction). Guard it and throw a CloudFormation ValidationError instead, matching how LambdaCfnProvisioner handles ReservedConcurrentExecutions.

Refs #4021
This commit is contained in:
Hector Ventura authored and GitHub committed 2026-09-21 07:00:19 -04:00
1 parent 60fd65b5b6
commit eb247a50aa
2 files changed
+21 -1

No files matched your search

@@ -748,7 +748,12 @@ public class ApiGatewayV2CfnProvisioner implements CfnResourceProvisioner {
String ttl = ctx.resolveOptional(props, "AuthorizerResultTtlInSeconds");
if (ttl != null) {
req.put("authorizerResultTtlInSeconds", Integer.parseInt(ttl));
try {
req.put("authorizerResultTtlInSeconds", Integer.parseInt(ttl));
} catch (NumberFormatException ignored) {
throw new AwsException("ValidationError",
"AuthorizerResultTtlInSeconds must be an integer", 400);
}
}
String simpleResponses = ctx.resolveOptional(props, "EnableSimpleResponses");
if (simpleResponses != null) {