AWS Builder Center
CloudCost Buddy: Automating AWS Budget Auditing with a Cost Watch Agent

CloudCost Buddy: Automating AWS Budget Auditing with a Cost Watch Agent

Learn how CloudCost Buddy models AWS multi-service architectures and uses a goal-based software agent to proactively detect budget overruns and provide actionable rightsizing steps.

Building CloudCost Buddy: A Goal-Based Cost Watch Agent for AWS Cloud Architectures

A submission for the AWS Builder Weekend Challenge: Build an Agent

๐Ÿš€ Live Demo & Links


๐Ÿ’ก The Problem: The AWS Cloud Bill Blindspot

Estimating and governing cloud infrastructure costs is one of the most critical challenges developers and architects face. While AWS provides enterprise-grade calculators and AWS Cost Explorer, engineers often encounter several hurdles during early-stage prototyping and project planning:
  1. Complex calculators: Sifting through hundreds of parameters when you just want a quick, realistic baseline architecture estimate.
  2. Post-facto surprises: Finding out you breached a personal or startup project budget only after the monthly AWS bill arrives.
  3. Actionability gap: Knowing a dollar amount is useful, but knowing what technical trade-offs will reduce costs without breaking architecture requirements is much more valuable.
To tackle this problem for the AWS Builder Weekend Challenge, I built CloudCost Buddy โ€” an intuitive, client-side AWS cost estimation platform paired with an intelligent Cost Watch Agent.

๐Ÿค– What is the Cost Watch Agent?

In the AI and software engineering world, an agent is defined as an entity that:
  1. Perceives its environment,
  2. Evaluates current state against a defined goal or boundary, and
  3. Acts or recommends actions to achieve that desired goal state.
While many challenge entries lean towards generative LLMs, generative models can introduce latency, non-deterministic hallucinations, recurring API token fees, and privacy concerns when analyzing sensitive cloud infrastructure blueprints.
For CloudCost Buddy, I built a Goal-Based Heuristic Software Agent that operates with 100% determinism, zero external API costs, and sub-millisecond execution directly in your browser.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
+-----------------------------------------------------------------+
| Cost Watch Agent Workflow |
+-----------------------------------------------------------------+
|
[1. Perceive: Inspect Saved Blueprints]
|
[2. Compute: Calculate Monthly Costs]
|
[3. Evaluate: Compare with Budget Goal ($)]
|
+----------------+----------------+
| |
[Within Budget] [Budget Breached]
| |
Status: Healthy Status: Alert
|
[4. Synthesize Findings]
|
[5. Generate Remediation Plan]
โ€ข Downsizing opportunities
โ€ข Tiering & lifecycles
โ€ข Concurrency optimizations

Agent Architecture: Perception to Action

  • Environment & State Perception: The agent continuously accesses and parses the active architectural estimates stored in local state/storage.
  • Goal Condition: A user-customizable monthly spending limit (e.g., $500/month).
  • Heuristic Auditing Engine: The agent recalculates baseline costs across all provisioned services (EC2, S3, Lambda, DynamoDB) using verified regional pricing structures (US East N. Virginia).
  • Goal-Directed Diagnostics: If an architecture exceeds the threshold, the agent isolates the exact culprit services contributing the highest proportion of the overrun.
  • Actionable Remediation Generation: The agent formulates concrete, step-by-step mitigation plans โ€” recommending EC2 instance right-sizing, S3 Intelligent-Tiering, Lambda memory rightsizing, and DynamoDB capacity optimizations.

๐Ÿ–ฅ๏ธ Key Features of CloudCost Buddy

1. Modern AWS-Inspired Dark Dashboard

  • Executive Summary Cards: Instant visibility into Monthly Costs, Annual Projections, Active Services, and Top Cost Drivers.
  • Service Distribution Visualizations: Dynamic bar charts and category breakdowns rendered with smooth micro-interactions.
  • Global AWS Region Selector: Switch regions with context-aware pricing labels.

2. Multi-Service Cloud Cost Modeler

Configure realistic parameters across core AWS primitives:
  • Amazon EC2: Select instance types (t3.micro, t3.small, t3.medium, m5.large, etc.), running hours, and EBS volume allocation.
  • Amazon S3: Model Standard Storage, Infrequent Access (IA), Intelligent-Tiering, and expected data retrieval queries.
  • AWS Lambda: Configure request invocation volume, average execution duration (ms), and allocated memory (MB) with automatic Free Tier deductions.
  • Amazon DynamoDB: Balance read/write capacity units (RCU/WCU) alongside persistent indexed storage.

3. Architecture Blueprint Templates

Get started in one click with pre-engineered architectures:
  • Scalable Web Application: Balanced compute, object storage, and serverless background workers.
  • Serverless Microservice API: Pure API Gateway, Lambda, and DynamoDB architecture.
  • Data Lake & Processing Pipeline: Heavy S3 storage footprint with on-demand compute batch jobs.

4. Client-First Privacy & Portability

  • Zero Backend Footprint: No credentials or architecture diagrams ever leave your browser.
  • Persistent Local State: Automatic localStorage synchronization across reloads.
  • Export & Share: Export complete cost models and itemized breakdowns to formatted JSON or CSV for executive stakeholder reports.

๐Ÿ› ๏ธ How It Was Built

CloudCost Buddy was engineered with modern frontend and cloud technologies:
  • React 18 & TypeScript: Strict type safety across all estimation equations, recommendation rule engines, and agent data contracts.
  • Vite: High-performance local development and optimized production bundling.
  • Recharts & Lucide React: Accessible, modern data visualizations and AWS-style iconography.
  • AWS Amplify Hosting: Continuous automated deployment connected to the Git repository, serving the application globally via Amazon CloudFront CDN edges with SSL.

๐Ÿงช Rigorous Testing & Reliability

A cost estimator and governance agent is only as good as its mathematical accuracy. CloudCost Buddy includes an automated unit testing suite powered by Vitest:
  • 11+ Unit Tests Passing:
    • Accurate monthly amortization of EC2 instance hours.
    • Multi-tier S3 gigabyte calculations and request fees.
    • Sub-cent precision for AWS Lambda execution compute-seconds.
    • Agent budget breach detection, threshold warnings, and remediation parsing logic.
1
2
3
4
5
โœ“ src/features/calc/calculateCost.test.ts (6 tests)
โœ“ src/features/agent/costWatchAgent.test.ts (5 tests)

Test Files 2 passed (2)
Tests 11 passed (11)

๐Ÿ”ฎ Future Roadmap & AWS Integration

While CloudCost Buddy runs entirely client-side today for instant accessibility, the architecture is designed to expand seamlessly into native AWS cloud services:
  1. Amazon Bedrock Integration: Enhance the heuristic remediation engine with Claude 3.5 Sonnet / Amazon Titan to generate natural language infrastructure-as-code (Terraform/CloudFormation) refactoring scripts.
  2. AWS Pricing API Real-Time Sync: Replace static pricing tables with an AWS Lambda function querying the AWS Price List API.
  3. AWS EventBridge + SNS Alerts: Schedule headless agent audits that dispatch budget alerts directly to Slack or email.

๐ŸŽฏ Conclusion

The AWS Builder Weekend Challenge is all about shipping practical, inventive solutions that empower builders. With CloudCost Buddy, developers gain immediate clarity over their AWS cloud spend, backed by a vigilant Cost Watch Agent keeping architectures within budget from day one.
Happy building on AWS! โ˜๏ธ
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article