Level 9 / Project 13 - Platform Cost Estimator¶
Home: README
Learn Your Way¶
| Read | Build | Watch | Test | Review | Visualize | Try |
|---|---|---|---|---|---|---|
| — | This project | — | — | Flashcards | — | — |
Focus¶
- Strategy pattern for cloud pricing models (on-demand, reserved, spot)
- Tiered pricing calculation with volume discounts
- Resource usage modeling: compute, storage, network, database
- What-if scenario analysis for cost optimization
- Cost optimization recommendations based on usage patterns
Why this project exists¶
Cloud infrastructure costs can spiral without visibility — a team discovers their monthly AWS bill doubled because someone left GPU instances running over a holiday weekend. This project models resource consumption across compute, storage, network, and database tiers, projects monthly costs using different pricing models, and runs what-if scenarios to find optimization opportunities. It teaches the same FinOps (financial operations) approach used by cloud cost management platforms like CloudHealth and Kubecost.
Run (copy/paste)¶
Expected terminal output¶
{
"total_monthly": 12450.00,
"by_resource": {...},
"what_if_savings": {...},
"recommendations": [...]
}
7 passed
Expected artifacts¶
- Console JSON output with cost estimates and optimization recommendations
- Passing tests
- Updated
notes.md
Alter it (required)¶
- Add a
SAVINGS_PLANpricing tier with even lower rates than reserved. - Add a
by_tagbreakdown that groups costs by resource tags (e.g. team, environment). - Add a
--budgetflag that compares estimated costs against a monthly budget limit.
Break it (required)¶
- Create a
ResourceUsagewithquantity=-100— does the cost calculation handle negatives? - Use a
PricingTier.SPOTfor a resource type with no spot pricing rule — what fallback occurs? - Set volume tier thresholds in non-ascending order — does
PricingRule.calculatebreak?
Fix it (required)¶
- Validate that
quantity >= 0in resource usage. - Sort volume tiers by threshold in
PricingRule.calculateto handle unsorted input. - Add a test for the fallback-to-on-demand pricing behavior.
Explain it (teach-back)¶
- How do cloud pricing tiers (on-demand, reserved, spot) differ in cost and commitment?
- What are volume discount tiers and how does tiered pricing work in practice?
- Why is what-if analysis important for infrastructure cost optimization?
- How do real FinOps teams use cost estimators to manage cloud spend?
Mastery check¶
You can move on when you can: - explain on-demand vs reserved vs spot pricing with real-world examples, - run a what-if scenario that shows savings from switching pricing tiers, - describe how volume tiers apply different rates to different usage ranges, - add a new resource type with custom pricing rules.
Related Concepts¶
| ← Prev | Home | Next → |
|---|---|---|