[Osaka/Yokohama/Tokushima] Looking for infrastructure/server side engineers!

[Osaka/Yokohama/Tokushima] Looking for infrastructure/server side engineers!

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Successor to CentOS] AlmaLinux OS server construction/migration service

[Successor to CentOS] AlmaLinux OS server construction/migration service

[For WordPress only] Cloud server “Web Speed”

[For WordPress only] Cloud server “Web Speed”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Reservation system development] EDISONE customization development service

[Reservation system development] EDISONE customization development service

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[Global exclusive service] Beyond's MSP in North America and China

[Global exclusive service] Beyond's MSP in North America and China

[YouTube] Beyond official channel “Biyomaru Channel”

[YouTube] Beyond official channel “Biyomaru Channel”

Notify CloudWatch alarms to Slack with AWS Chatbot!

*Miki Jet (Kobe Maya)

Hello!
My name is Hide, the ramen king of Beyond Osaka Office.
This is my 5th post.

Last time, I talked about notifying CloudWatch alarms to Teams/Chatwork, which I recently implemented in a project.

This time, we will talk about how to notify CloudWatch alarms to Slack using AWS Chatbot.

In my last blog post, I wrote an interesting article about using AWS Lambda and Python to get notifications, so if you're interested, please take a look!

I tried notifying CloudWatch alarms to Teams/Chatwork!

Configuration diagram

The configuration diagram is shown above.

Obtain EC2 metrics with CloudWatch and notify SNS when an alarm occurs. SNS then sends the alarm sent from CloudWatch to Chatbot.

The Chatbot then sends the alarm to Slack. It is easier to implement than Teams/Chatwork because it does not use AWS Lambda.

Let's work hard and build together!

Construction steps

① SNS

①-①: SNS > Topics > Click Create Topic

①-②: Specify the following information and click [Create topic]

● Type: Standard
● Name: Please enter your favorite name

 

①-③: Confirm that it was created successfully

② Chatbot

②-①: Chatbot > Configured clients > Click [Set new client]

②-②: Select Slack and click [Settings]

②-③: Sign in to the workspace

*If you have already logged in, you will see the screen below.
If you want to create a new workspace, click [Add another workspace] from the top right.

*How to find your Slack workspace URL is as follows.

Reference: Check the Slack URL of the workspace you are participating in

1. Click on the name of the workspace you are participating in

 

2. Under the workspace name, find the Slack URL of the workspace you're joining.

②-④: Log in to the specified workspace

②-⑤: Allow permissions


②-⑥: After confirming approval, click [Set new channel]

②-⑦: Enter the setting name

*Please set any setting name.
*If you want to record logs to CloudWatch Logs, please check the box.

②-⑧: Select Slack channel

*Select public or private, then select the channel name.

②-⑨: Set role

● Channel IAM role
A role that grants the same permissions to all members in a Slack channel.

● User role
A role that grants different permissions to each member of a Slack channel.

②-⑩: Set channel IAM role

*For the channel IAM role, select [Create an IAM role using a template].
*Please choose a role name of your choice.

②-⑪: Set policy template

②-⑫: Channel guardrail policy

● Channel guardrail policy
This is a policy that takes precedence over channel IAM roles and user roles.
If you turn on CloudWatchReadOnlyAccess, you can view the graph.

②-⑬: Notification settings

*Please specify the topic you created on SNS.

③ CloudWatch

*We will proceed with the assumption that EC2 has been created.

③-①:Cloudwatch>Alarm>Click [Create alarm]

Select your favorite metrics

③-③: Select alarm condition

③-④: Notification settings

③-⑤: Specify the alarm name

③-⑥Click [Create alarm]

④ Notification test

④-①: Check if the alarm is on.

④-②: Check whether the alarm has been notified

*If you set the threshold so that no alert occurs, you can check the recovery as shown below.

summary

This time, we introduced an article on how to notify Slack of CloudWatch alarms using Chatbot.

When sending alarm notifications in Slack, you can easily send notifications using a chatbot.
The graph URL and graph image are also included, so the alarm is very easy to read!

Slack is easy to implement, but if you want to notify alarms using Teams/Chatwork, you will have to write Python code with AWS Lambda, prepare webhooks, and take a lot of effort...

I would really like AWS to support Chatbots in Teams/Chatwork as well (although it probably won't be possible...)

If you found this article helpful , please give it a like!
15
Loading...
15 votes, average: 1.00 / 115
12,056
X facebook Hatena Bookmark pocket
[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

[Osaka/Yokohama] Actively recruiting infrastructure engineers and server side engineers!

[Osaka/Yokohama] Actively recruiting infrastructure engineers and server side engineers!

The person who wrote this article

About the author

Hide@Infrastructure Engineer

It all started with a very interesting interview.
A mid-career employee of the System Solutions Department in Osaka.My
job is to build and operate servers and clouds!
I have the qualifications of LPIC1, AWS SAA, and OCI Architect Associate.

Actually, I love ramen and
have investigated over 100 stores in Osaka (。-∀-) I'm striving to become the Ramen King of Nibi Beyond
!

I'm also on Twitter, so please follow me (´∇`)
Click on the Twitter mark on the right corner! !