Giter VIP home page Giter VIP logo

serverless-plugin-sns's Introduction

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

serverless-plugin-sns's People

Contributors

alastaircoote avatar lpinca avatar martinlindenberg avatar moee avatar

Watchers

 avatar  avatar

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.