On AWS, the timeout time for lambdas is 15 minutes. For CloudFront, the inactivity timeout time is 60 seconds aws link An easy way to get around this is then to just send a heartbeat ping every 30 seconds through the connection to keep it alive.
However, even with this solution, the SST SDK right now thinks both of these timeouts are the same, and applies a "take minimum of both values" approach. That is, if the timeout value is bigger than 120 seconds, it will return the following error:
✕ Failed
Server timeout for "xxx" is longer than the allowed CloudFront response timeout of 120 seconds. You can contact AWS Support to increase the timeout - https://console.aws.amazon.com/support/home#/case/create?issueType=service-limit-increase
The fix is quite simple, split the timeout of CloudFront and the lambda function, and return an error when out of bound individually. This way, you can set the lambda to 900 seconds, and CloudFront to whatever the account maximum is.
On AWS, the timeout time for lambdas is 15 minutes. For CloudFront, the inactivity timeout time is 60 seconds aws link An easy way to get around this is then to just send a heartbeat ping every 30 seconds through the connection to keep it alive.
However, even with this solution, the SST SDK right now thinks both of these timeouts are the same, and applies a "take minimum of both values" approach. That is, if the timeout value is bigger than 120 seconds, it will return the following error:
The fix is quite simple, split the timeout of CloudFront and the lambda function, and return an error when out of bound individually. This way, you can set the lambda to 900 seconds, and CloudFront to whatever the account maximum is.