AWS Chatbot is an interesting service that can integrate with both Slack and Chime.
Usually, when something happens in our AWS account, we invoke some alert mechanisms. The most common is the CloudWatch alarm that can invoke the SNS topic. The SNS topic is bound to the email or Lambda, and using both of them allows you to invoke any possible way you can think of to notify the end-user.
While sending an email is simple, invoking the Lambda to activate other notification options can be more difficult.
We can get the notification directly into Slack and Chime in a declarative manner by using AWS Chatbot.
Our architecture will be as following:
We will stress the EC2 instance to have high CPU usage. We will create an alert to monitor the CPU, and if alert happens, it will invoke the SNS topic that will be integrated with AWS Chatbot. We will set the relevant settings in Slack, Chime, and the chatbot to send the alert message.
To create the stress, we created an Amazon Linux EC2 instance and installed on this instance the "stress" utility.
sudo yum install -y epel-release
sudo amazon-linux-extras install epel
sudo yum install stress
Next we will create the SNS topic
Note!! The subscription part will appear later after you choose this topic in the chatbot console.
And after about a minute, I got the notification in both Slack and Chime.
No comments:
Post a Comment