Reputation: 1436
Is it possible to set a custom request integration timeout in AWS API Gateway in serverless.yml
configuration?
Although the question is quite straight forward I find a little of context always useful:
I need to notify the final user when the lambda function has timed out. Such situation could happen due to project requirements (lambda is communicating with third-party systems that may not be up). I came up with some other solutions, I believe setting the API-GW request timeout to the same time as lambda timeout is the best one, though.
Upvotes: 2
Views: 2235
Reputation: 150
Realised that with the recent update in serverless framework - function timeout is respected across the integration. All you have to do is pass timeout value in your function.
Here is an example:
functions:
myfunction:
handler: public/index.php
timeout: 15 #This will be same for integration timeout in API Gateway.
tags:
project: myproject
Upvotes: 3