# Published a Lambda Dead Letter Queue Plugin

**URL:** <https://forum.serverless.com/t/published-a-lambda-dead-letter-queue-plugin/1200>\
**Category:** Serverless Framework\
**Tags:** aws\
**Created:** [January 31, 2017, 3:28pm UTC](https://forum.serverless.com/t/published-a-lambda-dead-letter-queue-plugin/1200 "2017-01-31T15:28:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gmetzker](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/gmetzker/32/338_2.png) [@gmetzker](https://forum.serverless.com/u/gmetzker)\
**Post date:** [January 31, 2017, 3:28pm UTC](https://forum.serverless.com/t/published-a-lambda-dead-letter-queue-plugin/1200/1 "2017-01-31T15:28:41Z")

</div>

I’ve just created a plugin: [serverless-plugin-lambda-dead-letter](https://github.com/gmetzker/serverless-plugin-lambda-dead-letter) that can create a new dead letter queue (or topic) and attach it to a [Lambda’s `DeadLetterConfig`](http://docs.aws.amazon.com/lambda/latest/dg/dlq.html).

Unfortunately this is not supported in CloudFormation at this time so I’ve created the plugin to fill in the gaps.

The plugin can set the Lambda function’s `DeadLetterConfig.TargetArn` with one of the following:

- A newly created queue/topic created with simple syntax in the plugin’s `deadLetter.sqs` or `deadLetter.sns` properties.
- A pre-existing queue/topic using an `arn`
- A queue/topic created in manually in the `Resources` section of the `serverless.yml`

This is helpful if you want to have more fault tolerant event handling.

In one case I’ve used it more as a retry mechanism:

1. Configure lambda with a `deadLetter` setup so failed events are forwarded to sqs.
2. Set a scheduled event on the lambda with logic to retry events on the queue.
3. Lambda has an internal unwrapping mechanism to handle events that were:

- Sent directly
- Sent via SNS
- Pulled from retry queue during a scheduled event.

---

<div class="post-metadata">

**Author:** ![bhuvan.r](https://avatars.discourse-cdn.com/v4/letter/b/71e660/32.png) [@bhuvan.r](https://forum.serverless.com/u/bhuvan.r)\
**Post date:** [July 13, 2022, 12:31pm UTC](https://forum.serverless.com/t/published-a-lambda-dead-letter-queue-plugin/1200/2 "2022-07-13T12:31:06Z")

</div>

This package is having the below configuration error.  
Configuration error at ‘functions.’: unrecognized property ‘deadLetter’.  
There is some active PR in Repo. Can you merge the PR?
