Skip to content
New issue

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

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

Already on GitHub? # to your account

Gateway API: integration timeout cannot be over 29 seconds #30539

Closed
kraashen opened this issue Jun 13, 2024 · 6 comments · Fixed by #30547 · 4 remaining pull requests
Closed

Gateway API: integration timeout cannot be over 29 seconds #30539

kraashen opened this issue Jun 13, 2024 · 6 comments · Fixed by #30547 · 4 remaining pull requests
Labels
@aws-cdk/aws-apigateway Related to Amazon API Gateway bug This issue is a bug. effort/medium Medium work item – several days of effort p2 pr/work-in-progress This PR is a draft and needs further work.

Comments

@kraashen
Copy link

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,

@kraashen kraashen added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jun 13, 2024
@github-actions github-actions bot added the @aws-cdk/aws-apigateway Related to Amazon API Gateway label Jun 13, 2024
@nmussy
Copy link
Contributor

nmussy commented Jun 13, 2024

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

@ashishdhingra
Copy link
Contributor

@nmussy Thanks for the PR.

@ashishdhingra ashishdhingra added pr/work-in-progress This PR is a draft and needs further work. effort/medium Medium work item – several days of effort p1 and removed needs-triage This issue or PR still needs to be triaged. labels Jun 13, 2024
@ashishdhingra
Copy link
Contributor

Another issue #30550 related to timeout.

Copy link

⚠️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.

1 similar comment
Copy link

⚠️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.

sarangarav pushed a commit to sarangarav/aws-cdk that referenced this issue Jun 21, 2024
### Issue # (if applicable)

Closes aws#30539.

### Reason for this change

AWS , see [announcement](https://aws.amazon.com/about-aws/whats-new/2024/06/amazon-api-gateway-integration-timeout-limit-29-seconds/) and [Amazon API Gateway quotas](https://docs.aws.amazon.com/apigateway/latest/developerguide/limits.html)

### Description of changes

* Updated exception of `apigateway` `Integration` to only check the `timeout` lower bound
* Added exception check of the `timeout` prop to `apigateway-v2` `WebSocketIntegration`, to match the `apigateway` v1 behavior
* Implemented the `timeout` property to `apigateway-v2` `HttpIntegration` and its sub-integrations (`HttpAlbIntegration`, `HttpLambdaIntegration`, etc.)
* Updated TSDoc

### Description of how you validated changes

Updated unit and integration tests

### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
mazyu36 pushed a commit to mazyu36/aws-cdk that referenced this issue Jun 22, 2024
### Issue # (if applicable)

Closes aws#30539.

### Reason for this change

AWS , see [announcement](https://aws.amazon.com/about-aws/whats-new/2024/06/amazon-api-gateway-integration-timeout-limit-29-seconds/) and [Amazon API Gateway quotas](https://docs.aws.amazon.com/apigateway/latest/developerguide/limits.html)

### Description of changes

* Updated exception of `apigateway` `Integration` to only check the `timeout` lower bound
* Added exception check of the `timeout` prop to `apigateway-v2` `WebSocketIntegration`, to match the `apigateway` v1 behavior
* Implemented the `timeout` property to `apigateway-v2` `HttpIntegration` and its sub-integrations (`HttpAlbIntegration`, `HttpLambdaIntegration`, etc.)
* Updated TSDoc

### Description of how you validated changes

Updated unit and integration tests

### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@aws-cdk-automation
Copy link
Collaborator

Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one.

@aws aws locked as resolved and limited conversation to collaborators Jul 25, 2024
# for free to subscribe to this conversation on GitHub. Already have an account? #.