Registry / devops / serverless-plugin-lambda-dead-letter

serverless-plugin-lambda-dead-letter

JSON →
library1.2.1jsnpmunverified

This Serverless Framework plugin configures a DeadLetterConfig on AWS Lambda functions to send failed asynchronous invocations to an SQS queue or SNS topic. Currently at version 1.2.1 (last release 4 years ago), it uses UpdateFunctionConfiguration post-deploy since CloudFormation lacked support at the time. It can auto-create queue/topic with custom properties or reference existing ones. Note: no longer needed for Serverless v3+ which natively supports DeadLetterConfig, but still works for older versions.

npm install serverless-plugin-lambda-dead-letter
INSTALL
IMPORT
SIG · SERVERLESS-PLUGIN-
S
serverless-plugin-lambda-dead-letter
devopsjavascriptv1.2.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

plugin
plugins: - serverless-plugin-lambda-dead-letter
plugins: - serverless-plugin-lambda-dead-letter custom: deadLetter: ...
The plugin is referenced in serverless.yml under plugins, not in custom. Configuration is per-function under deadLetter property.
deadLetter.sqs
functions: myFunc: handler: handler.hello deadLetter: sqs: my-dl-queue
functions: myFunc: handler: handler.hello deadLetter: queue: my-dl-queue
Use sqs or sns, not queue. If sqs is a string, it creates a queue with that name; if an object, you can set properties like queueName, delaySeconds, etc.
deadLetter.sns
functions: myFunc: handler: handler.hello deadLetter: sns: my-dl-topic
functions: myFunc: handler: handler.hello deadLetter: topic: my-dl-topic
Use sns not topic. Similar to sqs, you can use a string or an object with topic properties.

Create a Lambda function with an auto-generated SQS dead letter queue using the serverless-plugin-lambda-dead-letter plugin.

# serverless.yml service: my-service provider: name: aws runtime: nodejs12.x plugins: - serverless-plugin-lambda-dead-letter functions: hello: handler: handler.hello deadLetter: sqs: my-dead-letter-queue
Debug
Known issues
deprecatedServerless Framework v3+ natively supports DeadLetterConfig in CloudFormation, making this plugin unnecessary for new projects.
fix
Remove the plugin and use the native CloudFormation property DeadLetterConfig under function's event or function properties. See Serverless docs.
affects: >=1.0.0
gotchaThe plugin uses a post-deploy API call (UpdateFunctionConfiguration) which can cause drift if the stack is updated without the plugin.
fix
Always use the plugin for updates to ensure the DeadLetterConfig stays in sync, or migrate to native CloudFormation.
affects: >=1.0.0
breakingPlugin only works with AWS provider. Does not support local or other cloud providers.
fix
Ensure provider is set to aws in serverless.yml, or use a different solution for non-AWS environments.
affects: >=1.0.0
Errors
Common errors & fixes
Does not support 'deadLetter' property on function
Plugin not loaded or wrong configuration syntax
fix
Ensure the plugin is listed under 'plugins' in serverless.yml, and that the deadLetter property is correctly nested under the function.
Queue name must be unique in this region
The auto-generated SQS queue name duplicate or violates AWS naming constraints
fix
Specify a unique queue name, or use the object syntax with queueName to provide a custom name.
The CloudFormation template is invalid: Unresolved resource dependency
Referencing a queue/topic that doesn't exist in the same template or is not exported
fix
Ensure the referenced resource (Ref or Fn::GetAtt) is defined in Resources and exported if needed, or use a string name for auto-creation.
Upgrade
Version history
1.2.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
Resources
serverless-plugin-lambda-dead-letter — npm install serverless-plugin-lambda-dead-letter · libregistry