项目作者: kaihendry

项目描述 :
Be notified of EC2 instance events 🚀 from any region 🗺️ via a Cloudtrail CloudWatch Logs subscription filter !Rules
高级语言: JavaScript
项目地址: git://github.com/kaihendry/sam-cloudtrail-ec2.git
创建时间: 2020-05-21T07:05:20Z
项目社区:https://github.com/kaihendry/sam-cloudtrail-ec2

开源协议:MIT License

下载


Prerequisites

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.

How do I know if I have deployed this?

Cloudwatch subscription

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.

Why not use Cloudwatch events?

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.

Maintenance consideration

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.