aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code

Home Page:https://aws.amazon.com/cdk

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gateway API: integration timeout cannot be over 29 seconds

kraashen opened this issue · comments

Describe the bug

AWS API Gateway timeout limit for integrations was previously 29 seconds. There has been an update to allow increasing the Gateway integration timeouts past the previous limit. https://aws.amazon.com/about-aws/whats-new/2024/06/amazon-api-gateway-integration-timeout-limit-29-seconds/

However, when implementing a Gateway API to Lambda, it seems that when synth'ing the stack, this seems to hit a validation error.

Expected Behavior

When configuring the Gateway API type (regional/private), timeout could be set over 29 seconds.

Current Behavior

When configuring the Gateway API, timeout cannot be over 29 seconds.

Error log when deploying/synth'ing

WARN AWS_SOLUTIONS_CONSTRUCTS_WARNING:  Possible override of timeout value.
Failed to synthesize: Error: Integration timeout must be between 50 milliseconds and 29 seconds.

Reproduction Steps

const ApiGateway = new ApiGatewayToLambda(
      this,
      'MyAPIGW',
      {
        lambdaFunctionProps: {
          runtime: Runtime.PROVIDED_AL2,
          handler: 'bootstrap',
          code: Code.fromAsset(join(__dirname, '..', '..', 'target', 'bin', 'linux', 'amd64', 'lambda', 'runtime')),
          timeout: Duration.minutes(5),
          environment: {
            ...
          },
        },
        apiGatewayProps: {
          defaultCorsPreflightOptions: {
            allowOrigins: ['*'],
            allowMethods: [HttpMethod.POST],
          },
          integrationOptions: {
            timeout: Duration.seconds(60),
          },
          endpointConfiguration: {
            types: [aws_apigateway.EndpointType.REGIONAL],
          },
        },
      },
    );

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.145.0

Framework Version

2.145.0

Node.js Version

20.14.0

OS

MacOS

Language

TypeScript

Language Version

No response

Other information

This issue came up when using aws-solutions-constructs. After quick look, it seemed to point to the Gateway API core package. Original issue reference here: awslabs/aws-solutions-constructs#1137,

I'll take care of it, thanks for the detailed issue 👍

@nmussy Thanks for the PR.

Another issue #30550 related to timeout.

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.