how to send AWS CloudWatch Alarms to Slack? (Terraform Included)
ฝัง
- เผยแพร่เมื่อ 1 ส.ค. 2024
- 🔴 - To support my channel, I’d like to offer Mentorship/On-the-Job Support/Consulting - me@antonputra.com
▬▬▬▬▬ Experience & Location 💼 ▬▬▬▬▬
► I’m a Senior Software Engineer at Juniper Networks (12+ years of experience)
► Located in San Francisco Bay Area, CA (US citizen)
▬▬▬▬▬▬ Connect with me 👋 ▬▬▬▬▬▬
► LinkedIn: / anton-putra
► Twitter/X: / antonvputra
► GitHub: github.com/antonputra
► Email: me@antonputra.com
▬▬▬▬▬▬ Related videos 👨🏫 ▬▬▬▬▬▬
👉 [Playlist] Kubernetes Tutorials: • Kubernetes Tutorials
👉 [Playlist] Terraform Tutorials: • Terraform Tutorials fo...
👉 [Playlist] Network Tutorials: • Network Tutorials
👉 [Playlist] Apache Kafka Tutorials: • Apache Kafka Tutorials
👉 [Playlist] Performance Benchmarks: • Performance Benchmarks
👉 [Playlist] Database Tutorials: • Database Tutorials
=========
⏱️TIMESTAMPS⏱️
0:00 Intro
0:42 Create SNS Topic
2:52 Create Slack App
3:58 Create Lambda Function
6:54 Subscribe Lambda to SNS Topic
9:09 Create CloudWatch Alarm
=========
Source Code
📚 - Tutorial: antonputra.com/amazon/send-aw...
#AWS #Slack #DevOps #CloudWatch - วิทยาศาสตร์และเทคโนโลยี
🔴 - To support my channel, I’d like to offer Mentorship/On-the-Job Support/Consulting - me@antonputra.com
Keep up the great work, much helpful as it's simple and straight forward, precise to the topic, good stuff.🙌
Thanks
It is a treat to find a video that is so concise and on-topic at exactly the right level. The Terraform bits went by pretty fast -- could you please post a link to your example code?
Thanks Grant! You can find link in the description.
Code: github.com/antonputra/tutorials/tree/main/lessons/122
Hi Anton if I understand the code well this is done to handle only a single alarm type. If we want to register multiple alarms what would the Lambda Function look like? Great video and it's very helpful thank you!
Diakuy, Anton. Duje vajlyva infa.
👉 How to Manage Secrets in Terraform - th-cam.com/video/3N0tGKwvBdA/w-d-xo.html
👉 Terraform Tips & Tricks - th-cam.com/video/7S94oUTy2z4/w-d-xo.html
👉 ArgoCD Tutorial - th-cam.com/video/zGndgdGa1Tc/w-d-xo.html
❤Performance Benchmarks Playlist - th-cam.com/play/PLiMWaCMwGJXl-h2RgOSpdO-pQaSRwlVjd.html
Great video, But I'm having trouble adjusting' Timezone, can you help me customize it?
I think you need to do it in code, convert utc to your timezone
Yes , but I am beginner
Can you have a sample for me?
Thankyou for reply Comment :)
can't get register and resolve alarm to work for different cw alarm, not with instanceid
Any errors?
@@AntonPutra no errors, simply the lambda doesn't get triggered when the status is changed i.e from In Alarm to OK
@Anton tnx for the reply and tnx for the tutorial, found the issue, I was missing the ok_actions and in my tf code, hence the resolve_alarm function was not triggered.
but what is most interesting. in the alarm on AWS console UI ok_actions and insufficient_data_actions are tied to the lambda arn, before specifying in tf.
@@sjokkz check if you receive sns messages from cw if yes check your logic
Can we get the terraform code as well
with a new tutorial sure
Great video, I have pasted the code in the lambda function and deployed changes but gettin the following error when testing it
{
"errorMessage": "'Records'",
"errorType": "KeyError",
"requestId": "92aef6ab-8aca-47bb-8445-65f3e4eb94d6",
"stackTrace": [
" File \"/var/task/lambda_function.py\", line 138, in lambda_handler
sns_message = json.loads(event[\"Records\"][0][\"Sns\"][\"Message\"])
"
]
}
can you help me with this
maybe you made a typo..