5

The serverless framework docs of AWS Event Bridge here do not mention how to set up a dead letter queue and retry attempts. I was hoping for the configuration of serverless.yml would look something like below but it did not work.

myLambda:
    handler:  ./src/functions/myLambda
    events:
      - eventBridge:
          eventBus: arn:aws:events:region:accountID:event-bus/busname
          deadLetterConfig: 
            arn: arn:aws:sqs:region:accountID:sqs-name
          pattern:
            source: 
              - ${self:custom.sourceNameForEventBus}

These properties can be added after the deployment manually as shown below. But I want to add it using the framework else if there is a way to manipulate this using CloudFormation? enter image description here

Deepak
  • 131
  • 1
  • 5

1 Answers1

0

I suspect this functionality has been released since the original question was asked but it is quite simple and documented.

functions:
  myFunction:
    handler: index.handler
    events:
      - eventBridge:
          eventBus: custom-saas-events
          pattern:
            source:
              - saas.external
          deadLetterQueueArn:
            Fn::GetAtt:
              - QueueName
              - Arn
          retryPolicy:
            maximumEventAge: 3600
            maximumRetryAttempts: 3
shenku
  • 11,969
  • 12
  • 64
  • 118