How to set DeadLetterQueue (DLQ) on AWS Lambda functions using the AWS CLI

UPDATE: It's important to note that as of now, DLQ's are ONLY supported in the us-east-2 (Ohio) region. While this command doesn't return any errors in other regions, it also doesn't make any changes.

One of the cooler announcements from re:Invent that you can start using right now is Dead Letter Queues (DLQ) for AWS Lambda functions. This has the advantage of allowing you to re-try, and alert, on events that fail even after being re-tried by AWS Lambda automatically.

You can find out more information on DLQ for Lambda by reading the official documentation, however in order to get quickly started with it, you should create a new SQS queue and configure a lambda function to send to it. This should be able to be done through the AWS Console, but it doesn't appear to be there yet, so here's how to get started with the CLI.

First, upgrade to the latest version:

sudo pip install -U awscli

Then, update your function:


aws lambda update-function-configuration --function-name LambdaFunctionName --dead-letter-config TargetArn=sqs or sns arn

That's it, you should start seeing DLQ events coming in on the SQS queue you configured anytime there is a complete failure, after Lambda's re-tries have all failed.

From here, you can set up alerts using SES, you could set this up to notify you via SNS, or have another Lambda function read the queue every few minutes to pick up and try re-processing the events at a later date.

Comments

sellakumar said…
I am really impressed with the way of writing of this blog. The author has shared the info in a crisp and short way.


Cloud Migration services

Aws Cloud Migration services

Azure Cloud Migration services
sellakumar said…
We are a part of the success story for many of our customer's successful cloud Migrations.
Vmware Cloud Migration services

Database Migration services
sellakumar said…
Thank you for the informative post about Security challenges in AWS , Found it useful . cloud migration services have now become secured and with no-risk

Lia Infraservices
sellakumar said…
Thank you for the informative post about Security challenges in AWS , Found it useful . cloud migration services have now become secured and with no-risk

Cloud Migration services


Best Cloud Migration Tool
Unknown said…
Instyle jackets is one of the best website for leather jacket products. Buy now to get the best services.

Unknown said…
Especially if you’re unfamiliar with the different types jackets and coats than we are here only to provide you ourb3 bomber sheepskin shearling leather jacket at your doorstep worldwide.

Gorish dua said…
Thanks for sharing.
We at Antino Labs believe in redefining and refining our model to suit the industry's requirements. Antino Labs' several years of experience in the market has let us register our global presence. Antino Labs' has the vision to become the world's most trusted partner for digital transformation and we aim to become a brand that defines innovation and the latest technology. We offer clients a one-stop solution for all their interests. Click the below links if you're looking for Web Development Company in Gurgaon, Website Designing Company in Gurgaon, Technology Consultant Services, Ecommerce Account Management Services, Mobile App Development Company in Gurgaon and UI UX Design Services.
Unknown said…
The Made in India, Debate and Discussion App which is the next revolution in social networking, Opinito networks you with other users who share your likes and dislikes – automatically!

Opinito provides you a platform where trending news and ideas are arranged in topics by community itself and it let you discuss and debate as per your opinions. There are 10K active users and more coming daily and posting regularly.

At Opinito You can choose from myriads of topics listed like Trending Political News, Sports News, Tech News and so on. All you have got to do is to Join your favorite topic by just hitting a like and let opinito create a personalized feed for you and there you go. Now, you can debate and discuss on any of the topic.

Download Now - Debate and Discussion App