Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Idea: Enhance autoCreate to create dead letter queues and redrive policies. #65

Open
tclindner opened this issue Jun 1, 2019 · 4 comments

Comments

@tclindner
Copy link

Thank you so much for your hard work on this project! 馃帀 It has made it really easy to work with SQS offline. I recently upgraded to v2. The autoCreate functionality works really well. I was able to replace a shell script that used the AWS cli to create queues. The only gap I have is dead letter queue (DLQ) support.

Current state:
autoCreate scans the lambda event sources for SQS events. Queues are built for each event source.

Proposed state:
Optionally(?) scan the resources section to see if CloudFormation templates exist for SQS. If so, generate DLQs first then add the main queues with redrive policies.

This may likely be outside the indented scope of this module. No worries if you aren鈥檛 interested in supporting it! 馃

@GonzaloSaad
Copy link

Hello! Is it possible to contribute to this issue? If so, do you have any contributing guidelines?

@anaerobic
Copy link

anaerobic commented Mar 29, 2021

here's a PR to allow auto-creating queues when you don't actually want to handle those events in a lambda:

https://github.com/CoorpAcademy/serverless-plugins/pull/172/files

functions:
  doStuffAsync:
    handler: src/handlers/doStuffAsync.handler
    events:
      - sqs:
          arn:
            Fn::GetAtt:
              - FifoQueue
              - Arn
  # this is for hacking serverless-offline-sqs to auto-create the DLQ for local development
  offlineAsync:
    handler: src/handlers/offlineAsync.handler
    events:
      - sqs:
          enabled: false
          arn:
            Fn::GetAtt:
              - DeadLetterFifoQueue
              - Arn

it's a little hacky, i know, but it gets the job done

@GonzaloSaad
Copy link

Right! I did the same as a workaround, I created a "fake" consumer just to make the lib create the DLQ. I wonder why you needed to make code changes for that!
I'll review the PR!

@anaerobic
Copy link

I needed the code changes to ensure that the fake consumer handler didn't actually consume messages off of SQS, because my use case requires consuming them in a long-running process outside of the serverless stack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants