Giter VIP home page Giter VIP logo

serverless-sns-to-sqs-events's People

Contributors

theburningmonk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

serverless-sns-to-sqs-events's Issues

Unable to subscribe to SNS topic using ImportValue

I'm trying to create a new queue, subscribing to an existing SNS topic but am getting an error:

  TypeError: Cannot read property 'replace' of undefined
      at ServerlessSnsToSqsEvents.getLogicalId (/app/node_modules/@totallymoney/serverless-sns-to-sqs-events/src/index.js:33:44)
      at ServerlessSnsToSqsEvents.getOrCreateSnsTopic (/app/node_modules/@totallymoney/serverless-sns-to-sqs-events/src/index.js:127:29)

Using config something like:

events:
      - snsToSqs:
          sns:
              Fn::ImportValue: MyEventNotificationTopic
          sqs:
              queueName: ${self:provider.stage}-${self:service}-queue

It looks like its expecting sns.displayName to be set as well, but I'm unclear how to give an existing topic and a display name: https://github.com/totallymoney/serverless-sns-to-sqs-events/blob/master/src/index.js#L127

Could it be that the isArn function is looking for a Fn::Import key instead of a Fn::ImportValue key? https://github.com/totallymoney/serverless-sns-to-sqs-events/blob/master/src/index.js#L29

I'd be happy to open a PR to fix this, let me know what you think. Thanks!

How to load plugin?

Thanks for this great plugin!

I'm having some trouble loading it in my serverless.yml, I think due to to the package's namespace.

Do you have any recommendations for how to get this loaded? I'd be happy to update the README if I could figure it out ๐Ÿ˜†

support FIFO queue creation

it would be great to support FIFO queue creation, as this kind of queue is already supported by EventSourceMapping.

      - snsToSqs: # configure a new queue and subscribe to new topic
          sns:
            topicName: yc-test-${self:provider.region}
            displayName: yc-test-${self:provider.region}  # required
          rawMessageDelivery: false
          batchSize: 10
          sqs:
            delaySeconds: 60
            visibilityTimeout: 120
            queueName: yc-${self:provider.region} # required
+            fifoQueue: true
            dlq:
              maxReceiveCount: 3
              visibilityTimeout: 120
              queueName: yc-dlq-${self:provider.region} # required

Once fifoQueue is true, CFN definition has FifoQueue: true flag and QueueName: <queueName>.fifo

allow user to override logical ID

This would help migrating to this plugin where you had previously provisioned the resources through custom CloudFormation resources, since we can ensure the logical IDs remain the same before and after switching to the plugin.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.