This project sends messages from a SNS topic to Slack using an AWS Lambda function which is subscribed to the SNS topic.
Explore the docs »
Table of Contents
In the current implementation AWS CDK is used to built the cloud infrastructure. It creates a SNS topic and a Lambda function in your AWS account. The lambda function subscribes to the topic and therefore gets triggerd every time a new message is published to the SNS topic. The topic's message is then sent to a Slack channel of your preference using IncomingWebhooks.
- Create an IncomingWebHook from Slack api which will generate a WebHook url
- Clone the repo
git clone [email protected]:ServerCentral/Slack-Integration.git
- Install NPM packages
npm install
- Copy .env.example file in the root .env file. Modify the path by adding the path from your WebHook url Example: WebHook url = https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX
WEBHOOKSPATH = /services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX
AWS CDK defines the cloud infrastructure and the code in slack-integration-stack.js creates cloud resources within stacks.
cdk synth
Synthesizes and prints the CloudFormation template for the specified stack(s)cdk diff
Compares the specified stack with the deployed stack or a local CloudFormation templatecdk deploy
cdk deploys the slack-integration-stack
Run the above commands from slack-integration directory