Serverless Plugin Notification
Requirement
- Serverless 1.x
- Project setup for AWS provider
Plugin installation
- Open a terminal to your Serverless project
npm install --save-dev serverless-plugin-notification
- Add
serverless-plugin-notification
in yourserverless.yml
file (see Serverless docs) - Follow platform specific installation
Supported platforms
Slack
Feature
- Notify service deployment to predefined Slack channel with custom username. Supporting states
- Deployment started
- Deployment succeeded
- Deployment failed (TODO)
- Predefined message format - General info in post, function and endpoint listing in thread reply
- Support Slack thread
- Support automatically retrieving deployer name
- EMOJIs !
Platform installation
In your serverless.yml
fill the following configuration
custom: notification: deployer: /* Default deployer name, if not automatically retrieve from local variable, if not default to 'Unnamed deployer' */ slack: token: /* Your slack token here */ - Follow https://api.slack.com/bot-users to get bot access token channel: /* Your channel name here */ e.g '#serverless' NOTE: Using direct message '@person' will have 'channel_not_found' error at `Deployment succeeded` and `Deployment failed` username: /* (Optional) Username that will be used to post the message */
Webhook
Feature
- Notify service deployment through http webhook POST using configurable url and headers. Supporting states:
- Deployment started
- Deployment succeeded
- Deployment failed (TODO)
Missing pieces
Content-Type
currently support onlyapplication/json
- Does not support CORs
Plattform installation
In your serverless.yml
fill the following configuration
custom: notification: webhook: url: /* Your webhook url here */ headers: /* Your headers here - Must be in object format */ Content-Type: application/json