Building AWS Cost Governance: Treating $500 Credits Like Production Budget
Built AWS cost governance tooling using $4 of $500 Community Builder credits by focusing on detection modules with confidence scoring instead of expensive lab infrastructure. Demonstrates how treating free credits like production budget teaches more than burning through them on vanity projects.

When AWS Community Builder credits arrived in my account $500 valid through October 2027. I faced a choice most engineers encounter: spin up expensive infrastructure to “learn by doing,” or build something that demonstrates the discipline those credits are meant to teach.
I chose the latter.
This is the story of building an AWS FinOps toolkit designed to prove one principle: operational maturity means treating free credits like someone else’s money.
The Problem With Free Credits
Free AWS credits create a peculiar engineering problem. The usual constraints budget oversight, cost accountability, resource cleanup vanish. You can launch whatever you want, however large, and someone else pays.
This is precisely when bad habits form.
In production environments, idle EC2 instances aren’t just wasteful they signal broken processes. Untagged resources mean accountability gaps. Low-utilization workloads running on oversized instances indicate missing governance. But with free credits, none of this registers as urgent.
I wanted to build something that would demonstrate the opposite behavior: cost-conscious engineering practiced deliberately, not just when the bill arrives.
The Strategic Question
How do you prove FinOps competence without burning through credits on vanity infrastructure?
Most portfolio projects solve this by:
- Building elaborate lab environments (expensive)
- Taking screenshots of fabricated data (dishonest)
- Avoiding the problem entirely (missed opportunity)
I needed a fourth option: build the tooling that would detect waste in a production environment, then prove it works without creating waste to detect.
This became the constraint that shaped everything.
What I Built
Three Detection Modules
The toolkit centers on three independent analyzers, each addressing a different operational cost problem:
1. Cost Allocation Engine
AWS Cost Explorer integration that attributes spend to teams via tagging.
python
python -m src.core.cost_allocation --demoTeam Monthly Δ MoM Idle Waste Compliance OwnerPlatform $312.40 +8% $42.10 96% platform-lead@company.comDevOps $181.20 -12% $9.50 88% devops-lead@company.comSandbox $67.80 +142% $31.20 41% [UNASSIGNED]⚠️ WARNING: 12.1% unallocated spend exceeds threshold (10.0%)Cost problems are organizational, not technical. Unallocated spend means accountability gaps. This module makes those gaps visible.
2. Idle Resource Detector
Multi-region scanner for persistent waste: EC2 instances with sustained low CPU, unattached EBS volumes, unallocated Elastic IPs.
python
python -m src.detectors.idle_resources --demo💤 Idle EC2 Instances (2 found)Instance ID Name Type Avg CPU Monthly Costi-0a1b2c3d4e5 dev-api-server t3.medium 3.2% $30.37i-9h8g7f6e5d test-worker t3.small 1.8% $15.18💰 Total Monthly Savings Potential: $61.15“Idle” isn’t the same as “underutilized.” This focuses on persistent waste (7-day lookback), not temporary dips that auto-scaling would handle.
3. Rightsizing Analyzer
This is where the project diverges from typical FinOps tooling.
Most cost optimization tools assume: Low CPU = downsize immediately.
That’s operationally dangerous.
My analyzer considers:
- CPU average AND P95 (not just averages)
- Burst behavior (spike frequency above 80%)
- Memory utilization (when CloudWatch agent is installed)
- Workload stability (variance between average and peak)
Then it assigns a confidence score (High/Medium/Low) and risk assessment before making recommendations.
python -m src.detectors.rightsizing --demoInstance: i-0a1b2c3d4e5 (api-server-prod)Current: t3.medium → Recommended: t3.smallConfidence: MediumRationale: Avg CPU 8.2%, 3 burst events (P95: 24.5%), avg memory 34.2%. Medium confidence - workload shows variability.⚠️ Risk Factors: - Workload exhibits occasional burst behavior (3 events detected) - P95 CPU at 24.5% - moderate headroom after downsize💡 Recommended Actions: - Consider resizing to t3.small - Monitor closely post-resize for 48 hours - Implement auto-scaling to handle burst traffic💰 Annual Savings: $182.28Naive automation causes production incidents. Confidence scoring acknowledges uncertainty. Risk context enables informed decisions instead of blind cost cuts.
This approach aligns with the AWS Well-Architected Framework’s Cost Optimization pillar: measure, monitor, improve but never at the expense of reliability.
Demo Mode: Making Work Reviewable
The constraint: How do you demonstrate working cost detection tooling without running expensive infrastructure to detect?
Answer: Build a demo mode.
Every module includes a
--demo flag that generates realistic sample data without touching AWS APIs:python -m src.core.cost_allocation --demopython -m src.detectors.idle_resources --demopython -m src.detectors.rightsizing --demoThis solves several problems:
- Zero cost: No AWS resources needed for screenshots
- Reproducible: Anyone can clone the repo and see realistic output
Architecture: Intentional Simplicity
AWS APIs (Cost Explorer, CloudWatch, EC2) ↓Detection Engines (3 independent modules) ↓Reporting Layer (JSON, CSV, Markdown, Terminal) ↓Optional: Lambda + EventBridge deploymentWhat’s absent:
- No databases. The modules are stateless cost data comes from AWS APIs, not stored locally. State would add complexity without improving detection accuracy.
- No message queues. There’s no distributed processing to coordinate. Each module runs independently and completes in under 60 seconds.
- No Kubernetes. Running a cost optimization tool on K8s would be ironic. The entire stack runs comfortably in a single Lambda function.
- No microservices. Three detection modules don’t need service boundaries, API gateways, or inter-service communication overhead.
- This restraint is deliberate. Overengineering a FinOps project is anti-FinOps. The architecture should feel lightweight and operational, not enterprise-scale for enterprise-scale’s sake.
This aligns with the Operational Excellence pillar of the Well-Architected Framework: build only what you need, automate thoughtfully, and design for maintainability.
Technical Decisions Worth Explaining
1. Why Confidence Scoring?
Most engineers building portfolio projects focus on capabilities (“look at all the things it detects!”). I focused on judgment (“here’s when recommendations should be questioned”).
High confidence: Stable workload, consistent metrics, clear downsize path
Medium confidence: Some variability, burst events, proceed with monitoring
Low confidence: Unpredictable patterns, missing data, manual review needed
Insufficient Data: <50 datapoints over 7 days, no recommendation
This framework acknowledges that automation should know its limits.
2. Why P95 Analysis?
Average CPU alone is misleading. An instance averaging 10% CPU might spike to 95% during traffic bursts. Downsizing based on averages could cause latency spikes or outages.
P95 utilization (95th percentile) reveals workload peaks. If P95 is high even when average is low, that’s a burst workload requiring headroom or auto-scaling, not downsizing.
This distinction separates “looked at metrics” from “understood the workload.”
3. Why Flag Missing Memory Metrics?
CPU-only analysis is incomplete. An instance might have low CPU but high memory pressure, making downsizing dangerous.
When CloudWatch agent isn’t installed (no memory metrics available), the analyzer:
- Lowers confidence score
- Flags as a risk factor
- Recommends installing monitoring before making changes
Don’t automate blindly when visibility is incomplete.
4. Why Cost Allocation Before Optimization?
The first module isn’t waste detection — it’s ownership attribution.
This priority is intentional. You can’t optimize what you can’t allocate. Untagged resources mean missing accountability. Cost allocation creates the governance foundation that makes optimization sustainable.
Organizations that skip this step end up in a cycle: cut costs → costs creep back → cut again. Without ownership, there’s no one responsible for keeping them down.
What This Demonstrates
This project isn’t about the technologies used (Python, Boto3, CloudWatch). Those are commodities.
It’s about operational thinking:
Cost Consciousness
Every decision optimized for minimal AWS spend while building AWS tooling. Total project cost: <$5. Designed to run on Lambda for <$10/month if deployed.
Risk Awareness
Confidence scoring and risk assessment acknowledge that automation without judgment causes incidents. Not every low-CPU instance should be downsized immediately.
Architectural Restraint
Three focused modules. No databases. No message queues. No Kubernetes. Every unnecessary system becomes future maintenance burden.
Well-Architected Alignment
- Cost Optimization: Automated waste detection + rightsizing
- Operational Excellence: Policy awareness + maturity-based recommendations
- Reliability: Risk assessment prevents naive automation
- Security: Tag compliance = governance foundation
FinOps Foundation Principles:
- Teams need to collaborate → Cost allocation enables ownership
- Decisions driven by business value → Confidence scores + context
- Everyone takes ownership → Accountability gaps highlighted
- Centralized team drives FinOps → Reporting enables governance
Results
What shipped:
- 3 working detection modules
- Demo mode for zero-cost demonstration
- Clean documentation (README, architecture diagram, contributing guide)
- Repeatable outputs (JSON/CSV/Markdown export)
- GitHub repository ready for technical review
Credits allocated: $500 (expires October 2027)
Credits used building this: ~$4
Projected monthly operational cost: <$10 (if deployed to Lambda)
Remaining credits: $496 for future experiments
You don’t prove cost discipline by spending more.
What’s Next
This toolkit is portfolio-complete but operationally incomplete. Future additions:
1. Tag Compliance Enforcement: Move from detection to prevention
2. Historical Trend Analysis: Track cost changes over time
3. Multi-Account Support: Consolidated reporting across AWS organizations
4. Terraform Deployment: Infrastructure-as-code for Lambda scheduling
5. Slack/Email Notifications: Automated alerting on threshold breaches
But those are features, not fundamentals. The current version already demonstrates what matters: operational judgment applied to cost governance.
For Engineers Building Portfolio Projects
If you’re building with AWS credits:
Avoid:
- Spinning up expensive infrastructure just to prove you can
- Optimizing for feature count over code quality
- Automating blindly without acknowledging risk
- Fabricating impressive-looking results
- Over-engineering for imaginary scale
Instead:
- Treat credits like production budget
- Build tooling that detects problems, not creates them
- Acknowledge uncertainty in recommendations
- Make your work reproducible (demo modes, clear docs)
- Let architectural decisions demonstrate maturity
Cost governance isn’t about finding the cheapest infrastructure. It’s about building systems that make waste visible, ownership clear, and decisions informed.
I still have $496 left to prove it again.
Links
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article