Relative Content

Tag Archive for node.jstypescriptaws-lambda

How to execute a piece of code when the Lambda Function timeout is nearly reached?

I’m working on a logger for a lambda function which will send logs to CloudWatch only if error log is written. For that I decided to accumulate the log actions until the end of the lambda function invocation and then call logger.commit() which will send the logs to Cloudwatch if at least one of the logs is the error log. The idea is to have the following pattern for the lambda function handlers: