Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Gateway To Lambda: timeout cannot be over 29 seconds #1137

Closed
kraashen opened this issue Jun 12, 2024 · 3 comments
Closed

API Gateway To Lambda: timeout cannot be over 29 seconds #1137

kraashen opened this issue Jun 12, 2024 · 3 comments
Labels
bug Something isn't working needs-triage The issue or PR still needs to be triaged

Comments

@kraashen
Copy link

kraashen commented Jun 12, 2024

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.

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),
          },
        },
      },
    );

Error Log

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

Environment

  • CDK CLI Version : 2.145.0 (build fdf53ba)
  • CDK Framework Version: 2.145.0
  • AWS Solutions Constructs Version : 2.60.0
  • OS : MacOS
  • Language : English

This is 🐛 Bug Report

@kraashen kraashen added bug Something isn't working needs-triage The issue or PR still needs to be triaged labels Jun 12, 2024
@kraashen kraashen changed the title API Gateway Lambda: timeout cannot be over 29 seconds API Gateway To Lambda: timeout cannot be over 29 seconds Jun 12, 2024
@kraashen
Copy link
Author

Based on quick triage, this error seems to propagate from the aws-cdk core library: https://github.com/aws/aws-cdk/blob/db3e77d4b32a7464b38f8502d7c113ac163e17dc/packages/aws-cdk-lib/aws-apigateway/lib/integration.ts#L207-L209

@kraashen
Copy link
Author

Fixed in aws-cdk release https://github.com/aws/aws-cdk/releases/tag/v2.147.0

@biffgaut
Copy link
Contributor

Sorry for the slow response, thanks for following up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage The issue or PR still needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants