1 Answer
- Newest
- Most votes
- Most comments
0
Hello.
How about getting events with EventBridge and running Lambda when you start EC2?
Please configure the EventBridge event pattern to catch "runinstances" from CloudTrail.
In Lambda, write code to set up a CloudWatch alarm.
By the way, if you use Systems Manager State Manager to install and configure CloudWatch Agent, there is no need to run a script on EC2.
https://medium.com/@yephonemyatishere/installing-cloudwatch-agent-in-ec2-on-launch-with-state-manager-3504cd486630
Relevant content
- Accepted Answerasked 4 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 20 years ago
- AWS OFFICIALUpdated a year ago
I think this sample on GitHub will be helpful. https://github.com/aws-samples/amazon-cloudwatch-auto-alarms