Dealing with Network Timeouts
Understand how to configure and manage network timeouts in AWS Lambda functions. Explore setting timeout values, using the getRemainingTimeInMillis method, and handling stalled network processes to improve error handling and client responses when working with external services.
We'll cover the following...
In the previous example, you were uploading relatively small files to S3, so that operation completes quickly. By default, Lambda allows a function just three seconds to finish. A process that is any longer will cause a timeout. If you plan to process larger blocks of data or perform many network requests within the same function, three seconds won’t be enough.
You can increase the allowed time by setting the Timeout property in the function SAM template. This value is measured in seconds and the maximum you can set it to is 900 (15 minutes). To change the value of the Timeout property for ...