☁️ DevOps Day 7 — Build a Simple AWS Resource Tracker using Shell Script
🚀 Introduction
🧰 Prerequisites
Before starting, make sure you have:
-
AWS CLI installed and configured →
aws configure -
Basic Linux knowledge (creating files, running scripts)
-
IAM permissions with
read-onlyaccess for EC2, S3, Lambda, and IAM
💻 Step 1: Create the Script
Create a new file named aws_resource_tracker.sh
⚙️ Step 2: Make It Executable
Then run it:
You’ll get an output like this:
⏰ Step 3: Automate It with Cron
To run it automatically every morning at 7:00 AM:
Add this line (update your path):
Now it will:
-
Run daily at 7 AM
-
Save a new report in
reports/ -
Log results in
cron.log
🔍 Step 4: Verify and Extend
You can later expand this script to:
-
Track EBS volumes, RDS instances, or CloudWatch alarms
-
Email the daily report using AWS SES
-
Upload results to S3 for central logging
-
Integrate with Slack alerts
🌟 Summary
By the end of this project, you learned how to:
-
Use the AWS CLI to query real-time resource data
-
Automate daily reporting using cron
-
Write a simple shell script that makes API calls to AWS
“DevOps isn’t just about deploying code — it’s about automating visibility.”
Comments
Post a Comment