Posted On: Nov 26, 2019

AWS Lambda now supports Destinations for asynchronous invocations, a new feature that allows you to gain visibility to asynchronous invocation result and route the result to an AWS service without writing code

Today, when you invoke a function asynchronously, Lambda sends the event to a queue. A separate process reads events from the queue and runs your function. When the event is added to the queue, Lambda returns a status code to acknowledge that the queue has received this event. However, you will not receive information confirming whether the event has been processed successfully or not.

With Destinations, you will be able to send asynchronous function execution results to a destination resource without writing code. A function execution result includes version, timestamp, request context, request payload, response context, and response payload. For each execution status (i.e. Success and Failure), you can choose one destination from four options: another Lambda function, an SNS topic, an SQS standard queue, or EventBridge.  

Now you can leverage various combinations of execution status, context, payload, and destination to build new capabilities with asynchronous invocations. For example, you can monitor the health of your serverless applications via execution status, send messages to SQS and SNS without writing code. At failure, you can route failed events to a destination to be investigated or processed in a different way. Destinations allows you to simplify your code and leverage built-in error handling controls on Lambda.

You can get started with these features via AWS Management Console, AWS CLI, AWS CloudFormation, or AWS SDK for Lambda. They are available at no additional cost in all AWS Regions where AWS Lambda is available. For more information on where AWS Lambda is available, see the AWS Region table. To learn more, see Lambda Destinations in the AWS Lambda Developer Guide, and visit blog post for Lambda Destinations.