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

(apigateway): support integration timeout >29 seconds

awsdataarchitect opened this issue · comments

Describe the bug

API Gateway now supports integration timeout greater than 29 seconds as released here.

This PR #14154 added a hard limit of 29000 milliseconds, so we need to remove that.

Expected Behavior

To be able to specify a value greater than 29 seconds from CDK

Current Behavior

Error: Integration timeout must be between 50 milliseconds and 29 seconds.
at new Integration (../node_modules/aws-cdk-lib/aws-apigateway/lib/integration.js:1:1439)
at new AwsIntegration (../node_modules/aws-cdk-lib/aws-apigateway/lib/integrations/aws.js:1:1140)
at new LambdaIntegration (../node_modules/aws-cdk-lib/aws-apigateway/lib/integrations/lambda.js:1:979)
at new CdkApiTimeoutDemoStack (../lib/cdk-api-timeout-demo-stack.ts:28:43)
at Object. (../bin/cdk-api-timeout-demo.ts:7:1)
at Module._compile (node:internal/modules/cjs/loader:1376:14)
at Module.m._compile (../node_modules/ts-node/src/index.ts:1618:23)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at Object.require.extensions. [as .ts] (../node_modules/ts-node/src/index.ts:1621:12)
at Module.load (node:internal/modules/cjs/loader:1207:32)

Subprocess exited with error 1

Reproduction Steps

// Integrate the Lambda function with the API Gateway
const getImageProcessingIntegration = new apigateway.LambdaIntegration(imageProcessor, {
requestTemplates: { 'application/json': '{ "statusCode": "200" }' },
timeout: cdk.Duration.seconds(35), // This throws Error: Integration timeout must be between 50 milliseconds and 29 seconds.
integrationResponses: [
{
statusCode: '200',
responseTemplates: {
'application/json': ''
}
}
]
});

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.145.0 (build fdf53ba)

Framework Version

No response

Node.js Version

v20.11.0

OS

macOS 14.4 Beta (23E5196e)

Language

TypeScript

Language Version

No response

Other information

No response

@awsdataarchitect Thanks for reporting the issue. Looks like it is similar to existing issue #30539. Please verify if that is the case, then we could close this issue since are other one has associated PR already drafted.

Thanks,
Ashish

@awsdataarchitect Thanks for reporting the issue. Looks like it is similar to existing issue #30539. Please verify if that is the case, then we could close this issue since are other one has associated PR already drafted.

Thanks,

Ashish

This one is for http integration allowMethods: [HttpMethod.POST], after reviewing the pull request it's making change for apigatewayv2 and apigateway but the http and websocket limits are still hard limit of 29 seconds

@awsdataarchitect Thank you for sharing the update. Great to hear that. Yes we need a PR to unblock the limit, before that, you can use escape hatches to override TimeoutInMillis to work it around. I am not pretty sure if it would work because per CFN doc of this property: Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds. Looks like this property still has the limit of 29 seconds. Please let me know if it works for you.

Kindly refer Using escape hatches for more details.

Thanks,
Ashish

closed by #30547

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