Dead letter queue config?

Hi,

could someone help with with an example of how to provide a dead letter queue for my existing SQS queue:

e.g. below

service: email-integration

provider:
name: aws
runtime: nodejs4.3

stage: dev
region: eu-west-1

iamRoleStatements:
- Effect: "Allow"
Action:
- "sqs:"
Resource: "arn:aws:sqs:
::emailtaskqueue"
- Effect: "Allow"
Action:
- "lambda:
"
Resource: “*”

functions:
hello:
handler: handler.hello
events: # All events associated with this function
- http:
path: hello
method: get

emailRequestListener:
handler: emailRequestListener/handler.emailRequestListener
events:
- http:
path: sendEmail
method: post

emailTaskConsumer:
handler: emailTaskConsumer/handler.emailTaskConsumer
timeout: 200
events:
- schedule: rate(1 minute)

emailWorker:
handler: emailWorker/handler.emailWorker

resources:
Resources:
EmailTaskDeadLetterQueue:
Type: 'AWS::SQS::Queue’
Properties:
MessageRetentionPeriod: 1209600
QueueName: emailtaskdeadletterqueue

EmailTaskQueue:
  Type: 'AWS::SQS::Queue'
  Properties:
    MessageRetentionPeriod: 1209600
    QueueName: emailtaskqueue
    RedrivePolicy:
        ???

Hey @walshe,
I know it might be a bit late, but I see the question is unanswered and I feel compelled to collaborate.

Please serve yourself how to setup the DLQ to a lambda function straight in your yml file, the next picture will show you an example, I’ll also paste some text down below, is as simple as that.

<your_function_name>:
handler: <your_handler>
timeout: 12
memorySize: 576
reservedConcurrency: 20 # optional, Overwrite the default reserved concurrency limit. By default, AWS uses account concurrency limit
onError: arn:aws:sns:eu-west-2:############:FailedFns # Optional SNS topic / SQS arn (Ref, Fn::GetAtt and Fn::ImportValue are supported as well) which will be used for the DeadLetterConfig

As you can see the bolded text, the [ onError ] config attr is the way to config the DLQ for a function. You are also allowed to use CloudFormation sintax here.

I hope this helps.

Cheers!
Hamlet