Skip to content

Twiage/cloudwatch-to-slack-lambda

Repository files navigation

lambda-cloudwatch-slack

An AWS Lambda function for better Slack notifications. Original blogpost about lambda setup

Overview

This function was originally derived from the AWS blueprint named cloudwatch-alarm-to-slack. The function in this repo improves on the default blueprint in several ways:

Better default formatting for CloudWatch notifications:

AWS Cloud Notification for Slack

Support for notifications from Elastic Beanstalk:

Elastic Beanstalk Slack Notifications

Support for notifications from Code Deploy:

AWS CodeDeploy Notifications

Basic support for notifications from ElastiCache:

AWS ElastiCache Notifications

Support for encrypted and unencrypted Slack webhook url:

Configuration

1. Clone this repository

2. Configure environment variables

cp .env.example .env

Fill in the variables in the .env.

3. Setup Slack hook

Follow these steps to configure the webhook in Slack:

  1. Navigate to https://slack.com/services/new and search for and select "Incoming WebHooks".

  2. Choose the default channel where messages will be sent and click "Add Incoming WebHooks Integration".

  3. Copy the webhook URL from the setup instructions and use it in the next section.

  4. Click 'Save Settings' at the bottom of the Slack integration page.

4. Deploy to AWS Lambda

The final step is to deploy the integration to AWS Lambda:

npm install
npm run deploy

Tests

With the variables filled in, you can test the function:

npm install
npm test

License

MIT License

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published