
Weekend Showcase Challenge: Why Did My AWS Bill Change?
An AI-powered assistant that analyzes period-over-period AWS cost changes to explain unexpected bill surges in plain language. It converts complex Cost Explorer data into clear explanations and actionable savings recommendations.
Have you ever opened your AWS Management Console, taken a look at your monthly billing dashboard, and instantly felt a spike of anxiety? A service cost doubled overnight, or an unexpected regional charge popped up, leaving you asking one question: “Why did my AWS bill change?”
I submitted this exact concept during the Summer Build Series Wishlist phase. My dream was a simple, single-click solution—a “Why did my bill change?” engine that compares billing cycles, isolates cost deltas, translates raw numbers into natural language, and provides immediate remedies.
For the Weekend Showcase Challenge, I built and launched a working prototype.
Vision and What It Does
The core mission of Why Did My AWS Bill Change? is to bridge the gap between complex financial reporting and actionable engineering decisions.
The Problem It Solves
AWS Cost Explorer is powerful, but navigating through multi-dimensional filters—like usage types, linked accounts, regions, and API calls—takes significant time. When a bill rises unexpectedly, engineers spend hours piecing together raw metrics to figure out what happened.
How It Works
The application executes a four-stage workflow: Compare → Investigate → Explain → Recommend.
- Compare: The engine pulls period-over-period billing data for two comparable cycles.
- Investigate: Deterministic backend rules flag significant spending deviations (surges or steep declines).
- Explain: Instead of dumping raw numbers, the system passes structured evidence to Generative AI models to convert variance into plain language.
- Recommend: The system suggests targeted optimization steps directly linked to identified resource changes.
Instead of presenting an abstract metric like
EC2: +$47.00 , the system generates human-readable clarity:"EC2 spending increased by $47.00 because additional compute usage (t3.xlarge) appeared ineu-west-1during the current billing period."
How I Built It: Process, Key Decisions & Challenges
Building an AI-assisted financial investigation tool required balancing statistical accuracy with flexible language synthesis.
Architectural Separation: Math vs. AI
The biggest architectural decision was enforcing a strict rule: The application calculates the numbers; the model explains the evidence.
Generative AI models struggle with consistent mathematical calculations. Forcing an LLM to read a raw multi-page CSV and guess cost changes leads to hallucinations. To avoid this:
- AWS Lambda performs 100% of the statistical calculations, delta comparisons, and sorting.
- Lambda constructs a deterministic JSON payload containing verified metrics.
- The AI layer receives this verified JSON payload strictly as a text-synthesis engine to explain why those numbers matter.
Challenge: Resource-Level Context
Connecting high-level cost anomalies to exact AWS resources presented a challenge. High-level Cost Explorer metrics do not always map cleanly to individual resource IDs without explicit opt-ins. I integrated AWS Resource Explorer query APIs alongside
GetCostAndUsageWithResources calls to bridge aggregate service cost spikes with actual instance metadata.AWS Services Used & Architecture Overview
The architecture relies on serverless and generative AI services on AWS.
Plaintext
AWS Billing Data / Cost Explorer API │ ▼ AWS Lambda (Backend Calculation & Logic) │ ┌─────────┴─────────┐ ▼ ▼AWS Resource Explorer Amazon Bedrock (Amazon Nova Models) │ │ └─────────┬─────────┘ ▼ Web Dashboard (Frontend Showcase)
- AWS Cost Explorer API: Retrieves programmatic billing, service, region, and usage-type metrics across defined timeframes.
- AWS Lambda: Hosts the backend logic, triggers API queries, calculates deltas, enforces thresholds, and coordinates the pipeline.
- AWS Resource Explorer: Executes resource-level discovery when cost anomalies point to specific tags or regions.
- Amazon Bedrock (Amazon Nova): Serves foundation models (such as Amazon Nova) to transform structured metrics into clear analysis and actionable recommendations.
- Amazon S3 & CloudFront / Web Dashboard: Delivers the interactive user dashboard.
What I Learned Across the Summer
Building this tool during the Summer Build Series taught me three critical lessons:
- AI Belongs at the Interface Layer: Generative AI is most effective when taking complex, structured data and rendering it accessible to humans. Using AI as an explanation engine rather than a calculation engine yielded better reliability.
- Context is Everything in Cloud Financials: A $50 increase on a staging database might be a major anomaly, while the same increase on a production cluster might be expected traffic growth. Providing regional and usage-type context makes financial metrics actionable.
- Simple Questions Lead to Deep Engineering: A one-sentence query like "Why did my bill change?" requires orchestration across IAM permissions, billing APIs, cross-region resource discovery, prompt engineering, and UI state management.
App & Repository Links
- GitHub Repository: https://github.com/ukatia/aws-bill-investigator
Community Inspiration
Inspired by Anshika Singh Sengar’s (@theartydev) journey of learning serverless architecture through hands-on AWS Weekend Builder Challenges, I was motivated to take a similar "learning by building" approach for this project.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article