I built an AI agent that reads my AWS bill and tells me exactly what to cut
AWS shipped its own FinOps Agent last week (June 9, public preview). It's genuinely good: plain-English cost investigations, anomaly root-cause, scheduled reports. But you don't have to wait for the preview, and you don't have to hand your entire cost dataset to a managed black box. You can build a leaner version yourself in an afternoon, and you'll understand every line of it.
Here's the core idea. Your AWS Cost and Usage data is just numbers. LLMs are great at turning structured numbers into prioritized, plain-English actions, IF you feed them the right slice. The pattern is four stages.
Stage one, Collect: pull the last 30 to 60 days of cost data from the Cost Explorer API (boto3, get_cost_and_usage), grouped by SERVICE and by linked account, plus rightsizing and idle-resource signals from Compute Optimizer and Cost Optimization Hub.
Stage two, Reduce: compress that into a compact JSON summary of top movers, week-over-week deltas, and biggest absolute spend. This is the step that matters most.
Stage three, Reason: hand THAT to Claude or GPT with a tight prompt. "You are a FinOps analyst. Here is the cost summary. Return the top 5 actions ranked by dollars saved per month, each with the exact AWS steps and the risk."
Stage four, Deliver: render the ranked report to Slack, a PDF, or a ticket.
The magic isn't the model. It's the data engineering before the model. Feed it raw billing CSVs and you get mush. Feed it a clean "top 10 movers plus deltas" summary and you get an action list a senior engineer would write.
Three things I learned the hard way. First, never paste raw account IDs or ARNs into a public LLM, mask them; FinOps data is sensitive. Second, anchor the model with thresholds: tell it to flag anything that grew over 20% week-over-week or any single idle resource over $200 a month, or it hedges. Third, make it output a diff, not a dashboard. "What changed and what do I do" beats "here are 40 charts" every time. That's literally why AWS's own agent emphasizes investigation summaries over more graphs.
I've put a complete, working Python script in the Classroom (step-by-step plus a hands-on lab). It runs read-only against your account, masks sensitive IDs, and produces a ranked savings report you can drop into Slack. Review and test it in a sandbox account before pointing it at prod. It's read-only, but always verify.
Real numbers from my test account: it surfaced an orphaned gp2 volume set and an over-provisioned RDS instance worth about $430 a month that I'd genuinely missed in the console. Twelve minutes of runtime.
Discussion question: what's the most expensive line item you've ever found buried in a cloud bill, and how long had it been bleeding money before you caught it? Drop it below. Best war story gets pinned.
0
0 comments
Richard Skacel
1
I built an AI agent that reads my AWS bill and tells me exactly what to cut
powered by
AI for Cloud Engineers
skool.com/cloud-cost-optimization-3746
Automate your cloud work with AI. GCP, Azure, VMware. Save hours every week with real workflows.
Build your own community
Bring people together around your passion and get paid.
Powered by