![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
serverless-plugin-lambda-dead-letter
Advanced tools
serverless plugin that can configure a lambda with a dead letter queue or topic
A serverless plugin that can assign a DeadLetterConfig
to a Lambda function and optionally create a new SQS queue or SNS Topic with a simple syntax.
Failed asynchronous messages for Amazon Lambda can be be sent to an SQS queue or an SNS topic by setting the DeadLetterConfig
. Lambda Dead Letter Queues are documented here.
At the time this plugin was developed AWS Cloudformation (and serverless) did not support the DeadLetterConfig
property of the Lambda so we have introduced a plugin that calls UpdateFunctionConfiguration
on the lambda after serverless deploys the CloudFormation stack.
v4.0
v1.4
Install the plugin.
npm install serverless-plugin-lambda-dead-letter
Install the plugin with npm and reference it in the serverless yaml file as documented here.
# serverless.yml file
plugins:
- serverless-plugin-lambda-dead-letter
Dead letter settings are assigned via a new deadLetter
property nested under a function in a serverless.yml
file.
There are several methods to configure the Lambda deadLetterConfig.
Use the deadLetter.sqs
to create a new dead letter queue for the function.
The resulting cloudformation stack will contain an SQS Queue and it's respective QueuePolicy.
# 'functions' in serverless.yml
functions:
createUser: # Function name
handler: handler.createUser # Reference to function 'createUser' in code
deadLetter:
sqs: createUser-dl-queue # New Queue with this name
# 'functions' in serverless.yml
functions:
createUser: # Function name
handler: handler.createUser # Reference to function 'createUser' in code
deadLetter:
sqs: # New Queue with these properties
queueName: createUser-dl-queue
delaySeconds: 60
maximumMessageSize: 2048
messageRetentionPeriod: 200000
receiveMessageWaitTimeSeconds: 15
visibilityTimeout: 300
Use the deadLetter.sns
to create a new dead letter topic for the function.
The resulting cloudformation stack will contain an SQS Topic resource.
# 'functions' in serverless.yml
functions:
createUser: # Function name
handler: handler.createUser # Reference to function 'createUser' in code
deadLetter:
sns: createUser-dl-topic
Use the targetArn
property to specify the exact SQS queue or SNS topic to use for Lambda dead letter messages. In this case the queue\topic must already exist as must the queue\topic policy.
Reference the ARN of an existing queue createUser-dl-queue
# 'functions' in serverless.yml
functions:
createUser: # Function name
handler: handler.createUser # Reference to function 'createUser' in code
deadLetter:
targetArn: arn:aws:sqs:us-west-2:123456789012:createUser-dl-queue
If you created a queue\topic in the resource
section you can reference it using the GetResourceArn
pseudo method.
This will use the arn of the resource referenced by {logicalId}
deadLetter:
targetArn:
GetResourceArn: {logicalId}
Note:
resources
section you will still need to add a resource for the respective queue\topic policy so that that lambda has permissions to write to the dead letter queue\topic.In this example the createUser
lambda function is using the new CreateUserDeadLetterQueue
SQS queue defined in the resources section.
# 'functions' in serverless.yml
functions:
createUser: # Function name
handler: handler.createUser # Reference to function 'createUser' in code
# ...
deadLetter:
targetArn:
GetResourceArn: CreateUserDeadLetterQueue
resources:
Resources:
CreateUserDeadLetterQueue:
Type: AWS::SQS::Queue
Properties:
QueueName: create-user-lambda-dl-queue
CreateUserDeadLetterQueuePolicy:
Type: AWS::SQS::QueuePolicy
Properties:
Queues:
- Ref: CreateUserDeadLetterQueue
# Policy properties abbreviated but you need more here ...
If you previously had a DeadLetter target and want to remove it such that there is no dead letter queue or topic you can supply the deadLetter
object with an empty targetArn
. Upon deploy the plugin will run the Lambda UpdateFunctionConfiguration
and set an empty TargetArn.
# 'functions' in serverless.yml
functions:
createUser: # Function name
handler: handler.createUser # Reference to function 'createUser' in code
# ...
# Set an empty targetArn to erase previous DLQ settings.
deadLetter:
targetArn:
FAQs
serverless plugin that can configure a lambda with a dead letter queue or topic
The npm package serverless-plugin-lambda-dead-letter receives a total of 25,453 weekly downloads. As such, serverless-plugin-lambda-dead-letter popularity was classified as popular.
We found that serverless-plugin-lambda-dead-letter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.