Socket
Socket
Sign inDemoInstall

serverless-plugin-sns

Package Overview
Dependencies
2
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    serverless-plugin-sns

Serverless SNS Plugin.


Version published
Weekly downloads
115
increased by121.15%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Serverless Plugin SNS

NPM

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

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

Keywords

FAQs

Last updated on 11 Aug 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc