Lambda and Lambda@Edge advanced topics and best practices
In Chapter 7, Evaluating the Best Architecture, we learnt about AWS Lambda basics. Here, we will discuss advanced topics and best practices about AWS Lambda and AWS Lambda@Edge.
The following sections provide advanced features to build Lambda applications:
- Environment variables
- Dead letter queues (DLQ)
Environment variables
Environment variables are key-value pairs. You can create and modify them from function configuration using the AWS Lambda Management Console, AWS Lambda CLI, or AWS Lambda SDK. For key-value pairs, AWS Lambda makes these available from the Lambda function code, which is using standard APIs. These APIs can support any language, such as Node.js functions, which is using process.env
.
Lambda functions enable environment variables to pass settings dynamically to the libraries and function code without any code being changed. Libraries can use environment variables to know which directory to install files to, where to store...