serverless-plugin-lambda-dead-letter
serverless-plugin-lambda-dead-letter copied to clipboard
lambda can't send message to dlq
Hi,
I found it not possible to send messages to the DLQ since the execution role of the lambda doesn't include SendMessage policy for the dead letter queue.
It is important to mention that it doesn't matter whether the SQS contains a policy that allows it to receive messages from the Lambda's ARN.
I also contacted Amazon support and they verified that this behavior is right.
Hopefully you figured it out, but as I also ran into the same problem I'm sharing my solution:
Add a role statement to serverless.yml:
provider:
iamRoleStatements:
- Effect: 'Allow'
Action:
- sqs:SendMessage
Resource:
- ARN for SQS queue goes here
Ideally this would be done automatically by the plugin.
This should be documented on the README.md. The short examples provided do not contain both creation of the queue and the permission grant. There should be examples on these variations as there are multiple ways of creating the queue.
The one thing that serverless framework and it's plugins often fail, is the documentation.