Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/totallymoney/serverless-sns-to-sqs-events
A Serverless framework plugin that simplifies the configuration of SNS to SQS to Lambda.
https://github.com/totallymoney/serverless-sns-to-sqs-events
Last synced: 3 days ago
JSON representation
A Serverless framework plugin that simplifies the configuration of SNS to SQS to Lambda.
- Host: GitHub
- URL: https://github.com/totallymoney/serverless-sns-to-sqs-events
- Owner: totallymoney
- License: mit
- Created: 2019-10-18T10:35:46.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-11-18T22:27:55.000Z (almost 4 years ago)
- Last Synced: 2024-09-09T11:04:32.390Z (2 months ago)
- Language: JavaScript
- Homepage:
- Size: 312 KB
- Stars: 17
- Watchers: 3
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# serverless-sns-to-sqs-events
[![serverless](http://public.serverless.com/badges/v3.svg)](http://www.serverless.com)
[![CircleCI](https://circleci.com/gh/totallymoney/serverless-sns-to-sqs-events.svg?style=svg)](https://circleci.com/gh/totallymoney/serverless-sns-to-sqs-events)
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)To install, run
```
npm i --save-dev @totallymoney/serverless-sns-to-sqs-events
```This is a [Serverless framework](https://serverless.com/framework) plugin that simplifies the configuration of SNS to SQS to Lambda.
Instead of:
1. configure the SNS topic
2. configure the SNS subscription
3. configure the SQS queue
4. configure the SQS queue policy
5. configure the SQS event subscription for Lambdayou can do all 5 as a `snsToSqs` event:
```yml
plugins:
- "@totallymoney/serverless-sns-to-sqs-events"functions:
hello:
handler: handler.hello
events:
- snsToSqs: # subscribe an existing queue to an existing topic
sns: "arn:aws:sns:#{AWS::Region}:#{AWS::AccountId}:my-topic"
rawMessageDelivery: true
sqs: "arn:aws:sqs:#{AWS::Region}:#{AWS::AccountId}:my-queue"
- snsToSqs: # reference custom resources in serverless.yml
sns: !Ref MyTopic
rawMessageDelivery: true
sqs: !GetAtt MyQueue.Arn
- 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
dlq:
maxReceiveCount: 3
visibilityTimeout: 120
queueName: yc-dlq-${self:provider.region} # required
```The full schema spec is available [here](/src/schema.js).