AWS API Gateway timeout after around 30 seconds. I connected the API gateway to a lambda function that runs far longer than 30 seconds.
So the API response times out after around ~30 seconds and give back something like a timeout response.
How do I solve this problem and get my response back from Lambda?
Thank you.
The API Gateway has a maximum integration timeout of 30 seconds (API Gateway Limits), so there is nothing you can do to increase it.
What you could do is accept the request, create and ID and put it in a queue. Then you send an HTTP 202 Message with the request id back to the client. Now a Lambda function can be triggered from the Queue asynchronously that performs the work. It later persists the results of the query somewhere under the request id (maybe only for a period of time). The client can then use the request ID and poll a second API gateway for the status, which is able to return the response once it's present.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With