-
Notifications
You must be signed in to change notification settings - Fork 4k
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
aws_apigateway: apigateway.LambdaIntegration Integration timeout must be between 50 milliseconds and 29 seconds. #31063
Comments
Yes according to this, we probably should unblock the limitation aws-cdk/packages/aws-cdk-lib/aws-apigateway/lib/integration.ts Lines 83 to 95 in 79b5cd2
and aws-cdk/packages/aws-cdk-lib/aws-apigatewayv2/lib/http/integration.ts Lines 260 to 262 in 79b5cd2
As there's no way to work it around, I am making it a p1 and we welcome pull requests. |
Hi @schaetay, I tried to reproduce the bug with the following code in cdk v2.151.0 but I was able to synth and deploy successfully after increasing the limit in my account/region. Based on checking further, seems this issue is already addressed in this PR #30547. It is available from CDK #v2.147.0.
Could you please let us know which CDK version are you using as there is possibility if the version < v2.147.0, then you might get a validation error during synth or deploy |
Thank you @godwingrs22 I will look into this issue again. |
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
Hi @godwingrs22 I tried again and yes I can reproduce this with 2.151.0 export class DummyStack2 extends Stack {
constructor(scope: Construct, id: string, props: StackProps) {
super(scope, id, props);
const api = new apigateway.RestApi(this, 'api', {
restApiName: 'api',
deploy: true,
endpointConfiguration: {
types: [ apigateway.EndpointType.REGIONAL ]
},
});
// dummy function
const fn = new lambda.Function(this, 'dummy-function', {
code: lambda.Code.fromInline('dummy'),
runtime: lambda.Runtime.NODEJS_LATEST,
handler: 'index.handler',
})
const lambdaIntegration = new apigateway.LambdaIntegration(fn, {
timeout: cdk.Duration.seconds(31)
});
api.root.addMethod('GET', lambdaIntegration);
}
} dummy-stack2: creating CloudFormation changeset...
I see this on Type: AWS::ApiGateway::Method
Properties:
AuthorizationType: NONE
HttpMethod: GET
Integration:
IntegrationHttpMethod: POST
TimeoutInMillis: 31000 <-----HERE
Type: AWS_PROXY
Uri:
Fn::Join:
- ""
- - arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/
- Fn::GetAtt:
- dummyfunction8EE12489
- Arn
- /invocations
ResourceId:
Fn::GetAtt:
- apiC8550315
- RootResourceId
RestApiId:
Ref: apiC8550315 Per doc:
I think the limitation is on CFN and CDK should catch that on synth. % npx cdk --version |
According to this, it's actually a soft limit which defaults to aws-cdk/packages/aws-cdk-lib/aws-apigateway/lib/integration.ts Lines 83 to 95 in 9acd528
And for REST API the value can be raised
That explains why CDK is not blocking that and just pass the value straight to CFN. |
Questions:
|
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
I was using cdk 2.141.0, after updates cdk to 2.155.0 worked for me. Thanks @godwingrs22 |
Describe the bug
The default integration for API Gateway is 29 seconds. After requesting an increase for the account/region I am unable to update the lambda integration timeout beyond the default 29 second timeout via the CDK however I am able to update the timeout beyond the default in the AWS Console.
Expected Behavior
The Lambda integration timeout should be updated to the specified value beyond the default 29 seconds when deploying via CDK.
Current Behavior
The Lambda integration timeout remains at the default 29-second limit even after deployment, despite the requested increase being successfully applied in the AWS Console.
Reproduction Steps
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.151.0 (build b8289e2)
Framework Version
No response
Node.js Version
v18.18.0
OS
Windows 11 Version 23H2
Language
TypeScript
Language Version
TypeScript 5.3.3
Other information
No response
The text was updated successfully, but these errors were encountered: