serverless-plugin-lambda-dead-letter icon indicating copy to clipboard operation
serverless-plugin-lambda-dead-letter copied to clipboard

lambda can't send message to dlq

Open nivpenso opened this issue 5 years ago • 2 comments

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.

nivpenso avatar Jul 04 '19 11:07 nivpenso

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.

jhdrn avatar Sep 10 '20 12:09 jhdrn

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.

OssiPesonen avatar Nov 11 '20 12:11 OssiPesonen