Integration of AWS Services with Slack Using AWS Chatbot
Tags: awschatbot, cloudwatch, sns, slack
Published: 2023-09-16 14:30:26

“ I have checked the documents of AWS to get the solution for integration of aws services chat as message to slack channel so that whenever any team wants to monitor the notifications of aws services and respond early in case of production, it's easy for them to handle the issue and resolve it as soon as possible. AWS chatbot provides the solution to integrate aws service with slack and easy to get the same notifications on email as well. In terms of cost, there is no charge for aws chatbot with this only need to pay the cost of services integrated with it.”

AWS Chatbot is an AWS service that enables DevOps and software development teams to use messaging program chat rooms to monitor and respond to operational events in their AWS Cloud. It processes aws service notifications from amazon sns and forwards them to chat rooms so teams can analyze and act on them immediately regardless of location.

In this post, you will experience the integration of aws services with slack using aws chatbot. Here I have created a sns topic with subscription, slack channel and aws chatbot workspace.

#Architecture Overview
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zecjkzyfgwqys42vcj87.jpg)
The architecture diagram shows the overall deployment architecture with data flow, aws chatbot, amazon cloudwatch, amazon sns, slack and email.

#Solution overview
The blog post consists of the following phases:

1. Create of Amazon Simple Notification Service with Email Subscription 

2. Create of AWS Chatbot with Integration of Chat Client SLACK

3. Testing of Cloudwatch Alarm Trigger to Send Notification as Message on Slack Channel

##Phase 1: Create of Amazon Simple Notification Service with Email Subscription 
1. Open the console of SNS, create a topic with email subscription.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b6eio96xvm9mebzj7roj.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rrgxwwqbvj07z8borzuo.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cauxi5g3as7zdky6fl5p.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5bdbnkq17t4408d31h4i.png)

##Phase 2: Create of AWS Chatbot with Integration of Chat Client SLACK
1. Open the aws chatbot console, configure a chat client SLACK named as aws-chatbot-service. Once done, goto slack and add a channel configured for aws service chat delivery in terms of message on slack.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8jvl6g91vxz2fbq1man7.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u27n10851taw107c3zka.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6vamff8wcy7mmlouirs2.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/idpq6w6d18ynadvqhjqv.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z64wpjjgwxefqoo1v6pu.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nyec01q023ucro4xh7l4.png)

2. Configure slack channel with logging enabled to deliver logs to cloudwatch and its required permissions to be set up. Also add sns topic to slack channel for notification of message delivered to slack from AWS service integrated.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rfqf7949r9xg7t61vib9.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lgp28fhkth7358ycuwhi.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e2m5738e0e8o1vufn370.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hs0gmeqo2ee69kz6vzs9.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6zhl7yo9zl0p8wzwke9k.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m42el9fvx0ulwkmbziv2.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zvlhtzijuvj9k2vb4nht.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c655cfeqxiowb83d5qlq.png)

3. Test of sending a text message from the slack workspace of aws chatbot is successful as received the message on slack and notification on email.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e6aexz9kamxcex1emu41.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1tl6f5mj8wzgw9ki2lqs.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0r9v189etsditol40p60.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9cuv4wa1lrxl0jythq7s.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5nwg6nt12sigcrtphvz2.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ljhkhrf2nx7rxmyfjcmu.png)

##Phase 3: Testing of Cloudwatch Alarm Trigger to Send Notification as Message on Slack Channel
1. Open the cloudwatch console, create an alarm for sns service. Once the alarm gets triggered, the notification will be sent to slack channel as well as on the email subscribed on topic.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/czajvy2bsehs0vvo87qx.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7tglghwgxavzxx3dvpox.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hmoy1a9q5pbo1p0x6sa8.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8eooodu4uc6r7k1vlugu.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wyte4fp0iu6xd8gehs0g.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wu1gf98nzx4bg5vavoz7.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/htsp7rnp7nydypv1gwp6.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ar4s5lgramowl23qj1cr.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mr9wtsy715z9rjcivxbl.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tkajji8pvko0taa0z7si.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9emqhcclydpt4tanb175.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i7d6qjij4kcc3qq0frr8.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b1lovr2kolf0q4p8wz1b.png)

#Clean-up
Delete of SNS, Cloudwatch and AWS Chatbot.

#Pricing
I review the pricing and estimated cost of this example. 

Cost of AWS Chatbot (Charges pay only for services used with this and no additional charge for chatbot service) = $0.0

Cost of Simple Notification Service = $0.0

Cost of CloudWatch = $0.02

Total Cost = $0.02

#Summary
In this post, I showed “how to do the integration of aws services with slack using aws chatbot”.

For more details on AWS Chatbot, Checkout Get started AWS Chatbot, open the [AWS Chatbot console](https://us-east-2.console.aws.amazon.com/chatbot/home?region=us-east-1#/). To learn more, read the [AWS Chatbot documentation](https://docs.aws.amazon.com/chatbot/?icmpid=docs_homepage_mgmtgov).

Thanks for reading!

Connect with me: [Linkedin](https://www.linkedin.com/in/gargee-bhatnagar-6b7223114)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/38sdi4nsp89fnui8h7dk.png)