Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kaihendry/sam-cloudtrail-ec2
Be notified of EC2 instance events π from any region πΊοΈ via a Cloudtrail CloudWatch Logs subscription filter !Rules
https://github.com/kaihendry/sam-cloudtrail-ec2
aws-billing aws-cloudtrail aws-ec2 aws-sam aws-sns serverless serverless-application-model
Last synced: 3 months ago
JSON representation
Be notified of EC2 instance events π from any region πΊοΈ via a Cloudtrail CloudWatch Logs subscription filter !Rules
- Host: GitHub
- URL: https://github.com/kaihendry/sam-cloudtrail-ec2
- Owner: kaihendry
- License: mit
- Created: 2020-05-21T07:05:20.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-06-01T06:06:05.000Z (over 4 years ago)
- Last Synced: 2024-05-28T14:23:11.215Z (5 months ago)
- Topics: aws-billing, aws-cloudtrail, aws-ec2, aws-sam, aws-sns, serverless, serverless-application-model
- Language: JavaScript
- Homepage: https://youtu.be/uDbQ9zl7xoU
- Size: 18.6 KB
- Stars: 9
- Watchers: 4
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html) and `sam deploy -g`.
# How do I know if I have deployed this?
There should be a subscription active upon **CloudTrail/DefaultLogGroup**.
Btw it takes **~15 minutes** for Cloudtrail to capture and log the event in [CloudWatch](https://ap-southeast-1.console.aws.amazon.com/cloudwatch/home?region=ap-southeast-1#logEventViewer:group=CloudTrail/DefaultLogGroup;filter=%257B%2520%2524.eventName%2520%253D%2520%2522RunInstances%2522%2520%257D) in my experience.
# Why not use Cloudwatch events?
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.