https://github.com/sc5/sns2slack
Push SNS topic notifications to slack
https://github.com/sc5/sns2slack
Last synced: 9 months ago
JSON representation
Push SNS topic notifications to slack
- Host: GitHub
- URL: https://github.com/sc5/sns2slack
- Owner: SC5
- License: mit
- Created: 2015-10-10T11:44:43.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-04-15T09:05:23.000Z (about 9 years ago)
- Last Synced: 2025-10-11T14:16:58.177Z (9 months ago)
- Language: JavaScript
- Size: 10.7 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AWS SNS to Slack gateway
An AWS Lambda function that publishes posts to Slack based on AWS SNS messages
## Installation
### Pre-requisites
Serverless Framework 1.5 or later.
### Setup
Clone the project to your environment
> git clone https://github.com/SC5/sns2slack.git
Copy the config template (src/config_template.json) to src/config.json. Set the slack channel and tokens to match your environment.
Install dependencies and deploy to AWS
> npm install
> sls deploy
## Using the Lambda function
The function for posting to Slack is invoked by sending a message to the SNS topic. The message is a JSON object that has been stringified (message has to be a string). The JSON format is:
{
"channel": "-SLACK CHANNEL NAME-",
"message": "-YOUR MESSAGE (TEXT)-",
"iconEmoji": "-EMOJI TO USE IF ANY-",
"senderName": "-YOUR-NAME-HERE-",
"attachments": [
{
"title" : "-FIRST-ATTACHMENT-TITLE-",
"text" : "-FIRST-ATTACHMENT-TEXT-"
},
...
]
}
## Release History
* 2017/04/15 - v1.0.0 - Port to Serverless Framework
* 2015/10/10 - v0.9.0 - Initial version of SNS 2 Slack gateway
## License
Copyright (c) 2017 [SC5](http://sc5.io/), licensed for users and contributors under MIT license.