I'm using a lambda function to process a large amount of data (which exceeds 30s) and I am receicing a message from AWS Gateway:
Endpoint request timed out
I understand this is obviously because of the default timeout with AWS Gateway, however my Lambda function is set to run for up to 15 minutes.
What is the best way to increase this timeout? Surely this can be done considering lambdas can be set to execute for a much longer time.
Thanks
API Gateway has a hard limit of 30 seconds. If your lambdas regularly take over 30 seconds (and you really need to use an API endpoint instead of a schedule, SQS or other source), you should use the lambda behind the gateway to trigger another lambda that does the actual work and give a response something like { "file_id": "some_id", "status": "in_progress"}
.
Then fetch the result of the work from another API endpoint.
And ideally you should also have another endpoint to check the status of the work so the user of the API knows when it is done and results are ready for download.