DEV Community

Prithiviraj R
Prithiviraj R

Posted on

The Smart Way to Automate AWS Cost Audits Across Multiple Regions

🌍 Why AWS Cost Audits Matter

Running workloads across multiple AWS regions gives you flexibility — but it also hides a silent cost problem: idle resources.
An EC2 instance left running, an unattached EBS volume, or an unused Elastic IP can quietly drain your monthly budget.

That’s where the AWS Cost Audit Tool comes in.
It’s a lightweight Dockerized app that scans all AWS regions, finds unused resources, and shows your potential monthly savings — all through a simple web dashboard.

I recently ran it across 17 regions, and the results were eye-opening.

⚙️ What the Tool Does

✅ Scans all AWS regions
✅ Detects idle EC2 instances, EBS volumes, and Elastic IPs
✅ Calculates potential monthly savings
✅ Displays real-time progress in a web UI

No need for complex APIs or third-party dashboards — just Docker, AWS credentials, and your browser.

🚀 Quick Start Guide

1️⃣ Prerequisites

2️⃣ Configure AWS Credentials

Create a .env file in your project folder:

AWS_ACCESS_KEY_ID=your-access-key-here
AWS_SECRET_ACCESS_KEY=your-secret-key-here
AWS_DEFAULT_REGION=us-east-1
Enter fullscreen mode Exit fullscreen mode

3️⃣ Deploy the Application

chmod +x deploy-simple.sh
./deploy-simple.sh
Enter fullscreen mode Exit fullscreen mode

Then open: 👉 http://localhost:8080

🧭 How to Use It

Step 1: Test AWS Connection

Click “Test AWS Connection”.
If everything’s configured correctly, you’ll see:

✅ Connected to AWS Account: [your-account-id]

Step 2: Run Full Audit

Click “Start Full Audit.”
The app will scan all regions — watch the progress bar and logs update live.
Takes around 5–15 minutes, depending on the number of resources.

Step 3: Review Results

When complete, you’ll see:

  • Total Idle Resources
  • Estimated Monthly Savings
  • Detailed Recommendations per resource

You can also export results to Excel for record-keeping or reporting.

If it says “Your AWS account is optimized!” — that’s a good thing 🎉

Excel Report

💡 What Gets Scanned

Resource Type Criteria Recommended Action Estimated Savings
EC2 Instances CPU usage < 10% (24h) Stop or downsize $8–200+/month
EBS Volumes Unattached (available) Delete $0.08–0.125 / GB / month
Elastic IPs Not associated Release $3.65/month per IP

This gives you visibility and actionable insights without manual digging.

📊 Real Results

After scanning 17 AWS regions, the tool revealed:

  • Multiple idle EC2 instances
  • Dozens of unused EBS volumes
  • A few unassociated Elastic IPs

That translated to immediate cost savings and a more optimized environment.

🧠 Final Thoughts

The AWS Cost Audit Tool proves that powerful automation doesn’t have to be complicated.
In just a few commands, you can audit your entire AWS footprint, visualize idle resources, and cut waste.

No third-party costs, no manual digging — just DevOps simplicity at its best.

💻 Simple setup. Real savings. Zero guesswork.
🚀 Run your own audit today and watch your AWS bill shrink!

Happy Learning

By Prithiviraj Rengarajan | DevOps & Cloud Engineer

Top comments (0)