totallymoney / serverless-sns-to-sqs-events Goto Github PK
View Code? Open in Web Editor NEWA Serverless framework plugin that simplifies the configuration of SNS to SQS to Lambda.
License: MIT License
A Serverless framework plugin that simplifies the configuration of SNS to SQS to Lambda.
License: MIT License
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!
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 ๐
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
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.