0.5.13 • Published 9 years ago
serverless-plugin-sns v0.5.13
Serverless Plugin SNS
This plugin easily subscribes your lambda functions to SNS notifications. If the required SNS-Topics don't exist, they will be created automatically during the deployment.
Note: This plugin supports Serverless 0.5.* (please see previous versions for older sls versions)
Installation
- make sure that aws and serverless are installed
- @see http://docs.aws.amazon.com/cli/latest/userguide/installing.html
install this plugin to your projects node_modules folder
cd projectfolder
npm install serverless-plugin-sns
- add the plugin to your s-project.json file
"plugins": [
"serverless-plugin-sns"
]
Run the Plugin
- the plugin uses a hook that is called after each deployment of a function
- you only have to deploy your function as usual
sls function deploy
- add the following attribute to the s-function.json in your functions folder
...
"sns": {
"topic": "your-dev-sns-topic"
},
...
- the topic will be created automatically, if not yet done
- topicnames can use the following dynamic template-names:
${project}
${stage}
${functionName}
example:
"sns": {
"topic": "${project}-sns"
},
Subscribe a lambda to multiple SNS Topics
- put an array of topics to the sns attribute
...
"sns": [
{"topic": "your-dev-sns-topic1"},
{"topic": "your-dev-sns-topic2"}
]
...
Next Steps
- create notifications that push events to sns topics
- for example: cloudwatch alerts can submit notifications to sns topics
- @see https://github.com/martinlindenberg/serverless-plugin-alerting :)
0.5.13
9 years ago
0.5.11
9 years ago
0.5.10
9 years ago
0.5.9
9 years ago
0.5.8
9 years ago
0.5.7
9 years ago
0.5.6
9 years ago
0.5.5
9 years ago
0.0.10
9 years ago
0.0.9
10 years ago
0.0.8
10 years ago
0.0.7
10 years ago
0.0.6
10 years ago
0.0.5
10 years ago
0.0.4
10 years ago
0.0.3
10 years ago
0.0.2
10 years ago
0.0.1
10 years ago