Skip to content

Latest commit

 

History

History
85 lines (43 loc) · 3.16 KB

AWS_CloudWatch_Slack_Integration.md

File metadata and controls

85 lines (43 loc) · 3.16 KB

CloudWatch integration with Slack

There are several different approaches to sending CloudWatch Alarms to Slack. For example, Lambda Functions could be used to establish the connection between AWS and Slack. This whitepaper will use an AWS ChatBot to establish integration between AWS CloudWatch and Slack. The configuration will start with creating an AWS SNS Topic for the CloudWatch Alarms. Once complete, the AWS Chatbot will be made, and messages received in the SNS Topic will be sent to the chosen Slack Channel.

AWS SNS Configuration

  1. In the Services search bar, search and select Simple Notification Service (SNS). On the SNS dashboard, select Topics and select Create Topic. This will route alerts to AWS Chatbot regarding the Chef Automate HA CloudWatch metrics.

  2. Select Standard as the SNS type.

  3. Enter a Topic name (you may want to name your topic after your PagerDuty service's name) and Display name, then select Create topic.

    SNS-Topic

AWS Chatbot Configuration

  1. Navigate to Services and search for Chatbot.

  2. In the Configure a chat client select Slack and select Configure Client.

    Chatbot

  3. You will be redirected to Slack.

  4. If you still need to authenticate to Slack, sign in.

  5. Select the Slack Workspace to which you would like to send alerts in the top right corner.

    Chatbot-Slack

  6. Select Allow, and you will be redirected to the AWS Chatbot configuration.

  7. Select Configure new channel.

    Chatbot-channel

  8. Provide a Configuration name.

    Chatbot-channel2

  9. Select the Slack Channel to send alerts to.

    Chatbot-channel3

  10. Under permissions, provide a Role name and keep the defaults for Policy.

    Chatbot-channel4

  11. Under Notifications – optional, select the region for the SNS Topic created earlier and select the SNS Topic.

    Chatbot-channel5

  12. Select Configure.

AWS CloudWatch Configuration

  1. Navigate to Services and search for CloudWatch. Navigate to All Alarms.

  2. Select any Automate HA alarms already created and select Actions – Edit.

  3. Confirm the configured Conditions are correct and select Next.

  4. For the Alarm state trigger, select In alarm.

  5. Under Notification, choose Select an existing SNS topic.

  6. Select the SNS topic created earlier in the Send a notification dropdown.

    CloudWatch

  7. Select Add Notification.

  8. In the new notification, select OK under the Alarm state trigger.

  9. Under Notification, choose Select an existing SNS topic.

  10. Select the PagerDuty SNS topic created earlier in the Send a notification dropdown.

    CloudWatch2

  11. Select Next and then Update alarm.

  12. Amazon CloudWatch and Slack have been integrated. When your alarm threshold is met, an incident will be triggered within the Slack Channel.

  13. The incident will automatically resolve once that alarm is back in an OK state.