Skip to content

Enable Dead-Letter Queues with AWS λ and SQS locally when developing your Serverless project

Notifications You must be signed in to change notification settings

pmaoui/serverless-offline-sqs-dlq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

serverless-offline-sqs-dlq

This Serverless-offline plugin brings Dead-Letter Queues to AWS λ and SQS queue on your local machine. It extends serverless-offline-sqs and thus depends on it.

Warning: Serverless doesn't support yet SQS for DLQ. After the deployment on AWS, the DLQ needs to be set on AWS (either manually or by a script).

Installation

First, ensure to have serverless-offline-sqs included in your project:

npm install serverless-offline-sqs serverless-offline-sqs-dlq

Then inside your project's serverless.yml file, add following entries to the plugins section before serverless-offline (and after serverless-webpack if presents).

plugins:
  - serverless-webpack
  - serverless-offline-sqs
  - serverless-offline-sqs-dlq
  - serverless-offline

Configure

Usage:

functions:
  basicLambda:
    handler: index.basicLambda
    events:
      - sqs: arn:aws:sqs:eu-west-1:XXXXXXX:basicLambdaTriggerQueue
  handleErrorLambda:
    handler: index.handleErrorLambda
    events:
      - sqs: arn:aws:sqs:eu-west-1:XXXXXXX:handleErrorLambdaQueue

Specify in the custom section which function handles errors:

custom:
  (...)
  serverless-offline-sqs-dlq:
    basicLambda:
      onError: handleErrorLambda
      maxReceiveCount: 3

About

Enable Dead-Letter Queues with AWS λ and SQS locally when developing your Serverless project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published