Bring AWS Notifications Into Your Slack Channel
Tags: sre, devops, monitoring, aws
Published: 2022-11-28 12:13:26


Today’s software development lifecycle world requires responding to notifications immediately; such as incidents, application deployments, security events and so on.

### ChatOps — The Slack Way

Nowadays, most of the DevOps teams rely on [Slack](https://slack.com/) to collaborate with team members and the system they manage. In the notifications, teams might need to switch among Slack, email, text messages and phone calls at the end of the day. In addition to context switching, merging the data from all those different sources is inefficient and time consuming for teams who monitor and interact with their AWS resources.

Meet [AWS Chatbot](https://aws.amazon.com/chatbot/). Interactive agent that makes it easier to monitor and interact with your [Amazon Web Services (AWS)](https://aws.amazon.com/) resources from your team’s Slack channels. By integrating AWS Chatbot with Slack, DevOps teams can receive real-time notifications, view incident details, and response incident quickly without need to cycle among other tools.
>  “With AWS Chatbot, all notifications centrally managed within Slack that our teams already use every day. We’ve configured to receive various notifications such as network & system alerts, application deployments, performance monitoring and more directly into related Slack channels. Teams can take action immediately without needing to switch from where they’re already working. This speed up our response time and overall development agility.” — Engin Altay, SRE, Foreks Digital.


### Integrating AWS Chatbot with Slack

Let’s move on AWS Console to begin integrating AWS Chatbot with Slack channel.

### Create an Amazon SNS Topic

[Amazon Simple Notification Service (SNS)](https://aws.amazon.com/sns/) is a fully managed Pub/Sub messaging service that can send notifications two-ways, A2A and A2P.

To create Amazon SNS topic, navigate to AWS Console, go SNS dashboard and create ***Standart*** type of topic.

![Create standart type of Amazon SNS topic](https://cdn-images-1.medium.com/max/2236/1*0T0R0iLFoL22I84iChKaLA.png)

### Setting up AWS Chatbot

[AWS Chatbot](https://aws.amazon.com/chatbot/) is an AWS service that enables ChatOps for teams. AWS Chatbot processes notifications from Amazon Simple Notification Service (Amazon SNS), and forwards them to chat rooms so teams can monitor and respond to AWS related events in their Slack channel.
>  AWS Chatbot supports Amazon Chime or Slack chat clients.

Navigate to AWS Console, go to AWS Chatbot and configure new client.

![AWS Chatbot — Configure new client type as Slack.](https://cdn-images-1.medium.com/max/2000/1*XXly036pL0i8fNsLJjjOpw.png)

When you click configure, you’ll be redirected to Slack workspace.

![Add AWS Chatbot to Slack workspace](https://cdn-images-1.medium.com/max/2024/1*5UMTtqF-ZYO_2WYro2p_Zg.jpeg)

Click Add to Slack, and you’ll be asked for required permissions for AWS Chatbot to interact with your Slack channel.

*Rename bot user as you wish, which will be shown in your Slack channel.*

![.](https://cdn-images-1.medium.com/max/2000/1*j03mCa2kcq8rq-X5Z1qWCg.png)

Then, add bot user to Slack by running the following command in related channel.

    /invite @aws-bot

### AWS Chatbot — Configure the Slack Channel Settings

AWS Chatbot requires your Slack channel ID to send notifications to specified channel.

![AWS Chatbot requires Slack private channel ID.](https://cdn-images-1.medium.com/max/2000/1*mIUWPbcNeWWtiIFBUAh35g.jpeg)
>  In Slack, get channel ID by right clicking the channel and copy the link. Channel ID is the string at the end of the URL.

Then, AWS Chatbot requires IAM permissions to perform actions.

![AWS Chatbot needs IAM role to perform actions.](https://cdn-images-1.medium.com/max/2000/1*OjrxdhSbUGALVssXpbuMdg.png)

From the policy templates, select Notification permissions. It’s enough to get metric from Amazon CloudWatch.

Lastly, AWS Chatbot needs SNS topic you previously created to send notifications from AWS services to your chat client.

![AWS Chatbot — select SNS topic and region its created.](https://cdn-images-1.medium.com/max/2000/1*HCjd-dEfp_NmKP5-vLELiA.jpeg)

Click Configure, and that’s it! Successfully integrated AWS Chatbot with Slack workspace.

To verify, go to SNS dashboard and see subscription status is confirmed for AWS Chatbot.

![SNS topic subscription confirmed for AWS Chatbot.](https://cdn-images-1.medium.com/max/2196/1*3cf79iU-qQpC7V4_0X7iUQ.jpeg)

After all integration and configuration steps, I’d like to show a real world example that one of our alarm from AWS CloudWatch displayed as rich messages with graphs in our Slack channel.

![.](https://cdn-images-1.medium.com/max/2776/1*zp9gTc7vMTwTWYxnhU3OOA.jpeg)

Leveraging AWS Chatbot makes organizations easily manage, centralize, and monitor AWS notifications into their daily chat rooms. With AWS Chatbot, teams can collaborate and respond to events faster.

Thank you for taking the time to read my article. I appreciate you sharing your thoughts and feedback.

**Resources**

* [*https://aws.amazon.com/chatbot/](https://aws.amazon.com/chatbot/)*

* [*https://docs.aws.amazon.com/chatbot/latest/adminguide/what-is.html](https://docs.aws.amazon.com/chatbot/latest/adminguide/what-is.html)*

* [*https://aws.amazon.com/blogs/aws/aws-chatbot-chatops-for-slack-and-chime/](https://aws.amazon.com/blogs/aws/aws-chatbot-chatops-for-slack-and-chime/)*