Configure dead letter queues in Lambda for more reliable event processing

By default, a failed Lambda function invoked asynchronously is retried twice, and then the event is discarded. Using Dead Letter Queues (DLQ), you can indicate to Lambda that unprocessed events should be sent to an Amazon SQS queue or Amazon SNS topic instead, where you can take further action.

You configure a DLQ by specifying a target Amazon Resource Name (ARN) on a Lambda function’s DeadLetterConfig parameter of an Amazon SNS topic or an Amazon SQS queue where you want the event payload delivered, as shown in the following code. For more information about creating an Amazon SNS topic, see Create an SNS Topic. For more information about creating an Amazon SQS queue, see Tutorial: Creating an Amazon SQS Queue.


AWS CloudFormation Supports AWS Serverless Application Model, AWS Lambda Environment Variables, and New CLI Commands

You can now provision and manage resources for AWS Lambda-based applications using AWS CloudFormation and the AWS Serverless Application Model (AWS SAM). SAM helps you more effectively model, package, and deploy “serverless” applications which use services like AWS Lambda, Amazon DynamoDB, and Amazon API Gateway. SAM is a specification for describing Lambda-based applications and offers a syntax designed specifically for expressing serverless resources. Learn more about SAM here.

To get started, you model your serverless resources in a CloudFormation template using SAM syntax, specify serverless in the Transform section of your template, and then use change sets to preview and create the stack.

You can now also use new AWS CLI commands for package and deploy, which simplify the process of uploading source code from your local drive and creating your resources. For example, you can use the package command to upload source code for Lambda functions, API Gateway Swagger files, or AWS Elastic Beanstalk applications.

CloudFormation has also introduced the following updates:

AWS Lambda environment variables: Set environment variables for Lambda functions.
Amazon SNS subscriptions: Subscribe an endpoint to an SNS topic.