Setup Cloudtrail to log to CloudTrail/DefaultLogGroup.
Setup an SNS Topic with subscribers who would like to be informed when an EC2 is launched in any AWS region.
SAM CLI and sam deploy -g
.
There should be a subscription active upon CloudTrail/DefaultLogGroup.
Btw it takes ~15 minutes for Cloudtrail to capture and log the event in CloudWatch in my experience.
https://aws.amazon.com/premiumsupport/knowledge-center/ec2-email-instance-state-change/ is a good tip, but what they don't tell you, is that you need to deploy in EVERY REGION for it to work.
Cloudtrail bucket isn't used by this function, so consider putting an expiration on the objects.
Similarly CloudTrail/DefaultLogGroup can get large, put a retention policy on it.