DEV Community

Cover image for Cost-Sentry: Optimizing AWS Spend with AI-Driven FinOps Auditing
Mahesh
Mahesh

Posted on

Cost-Sentry: Optimizing AWS Spend with AI-Driven FinOps Auditing

GitHub Copilot CLI Challenge Submission

What I Built

In a sprawling cloud environment, "zombie" resources specifically unattached EBS volumes are a silent drain on the budget. As a Cloud Architect, I wanted to build a tool that doesn't just manage infrastructure but optimizes its cost.

I built Cost-Sentry, a FinOps agent that identifies unattached EBS volumes and calculates their financial impact. It uses the GitHub Copilot CLI as a reasoning engine to generate complex Boto3 auditing scripts, which are then used to produce immediate, actionable saving reports.

Demo

The tool is designed for high-velocity cost audits and is now part of my public GitHub portfolio.

🔗 GitHub Repository: https://github.com/mpawar006/cost-sentry

Cost-Sentry in Action

The tool scans for volumes in the available state and applies a standard rate of $0.10 per GB/month to estimate waste.

Cost-Sentry

Figure 1: Cost-Sentry successfully identifying 20GB of unattached storage waste.

Financial Impact Detected:

  • Total Volumes Audited: 2

  • Total Wasted Capacity: 20 GB

  • Potential Monthly Savings: $2.00

My Experience with GitHub Copilot CLI

Building this fourth project on my local machine solidified how AI can be a force multiplier for cloud management.

  • Logic-Driven Prompt Engineering: Unlike standard code-gen, I used a structured cost_library.json to feed specific financial archetypes into the GitHub Copilot CLI. This allowed the AI to focus on the mathematical reasoning required for cost estimation rather than just boilerplate code.

  • The "Safety-First" Approach: A major takeaway from this challenge was ensuring AI-driven velocity doesn't bypass safety guardrails. I engineered Cost-Sentry as a read-only auditor, proving that AI agents can be highly impactful without needing high-risk permissions.

  • FinOps Visibility: The CLI allowed me to quickly prototype the logic needed to parse deeply nested AWS resource metadata and transform it into a clean, human-readable terminal table using the tabulate library.

Top comments (0)