This AWS Lambda function will send you once a day a recap email with the list of the running EC2/RDS instances on all AWS region for a giver AWS Account. I'm using this for non-prod, lab, sandbox, and personal AWS accounts, to get a kindly reminder of what I've left running. ๐ธ
- List running EC2 instances across all AWS Regions.
- Check
name
,instance-id
,instance_type
,key_name
,region
,launch_time
- Check
- List running RDS instances across all AWS Regions.
- Check
db_instance_name
,db_engine
,db_type
,db_storage
,region
,launch_time
- Check
- White list capability using the
iw
tag - Send summary by email once a day
- Serverless Architecture using Lambda, Lambda layer and SES
- Verify your sender SES email
- Create
<your_project_name>-artifacts
s3 bucket (default isinstance-watcher-artifacts
)
Change emails settings in Makefile
or use command-line
Nb: Recipients are space-delimited
RECIPIENTS := [email protected] [email protected]
SENDER := [email protected]
You will need to validate email received from AWS SES.
$ make layer
$ make package project=<your_project_name>
$ make deploy \
ENV=<your_env_name> \
AWSREGION=<your_aws_region> \
PROJECT=<your_project_name> \
[email protected] \
RECIPIENTS='[email protected] [email protected]'
Nb: Use emails in command line is optional if your already setup the Makefile
$ make tear-down
If you want to whitelist a specific EC2 instance to be hidden from the daily report, you will need to add the following tag to the EC2 instance.
Key | Value |
---|---|
iw |
off |
- Add SES setup built-in
- Whitelist for RDS Instances
- Add unit tests
- Multi-Account Support
- Add
Instance Profile
column - Add pricing column