# 💰 As-Built Cost Estimate: {project-name}

![Step](https://img.shields.io/badge/Step-7g-blue?style=for-the-badge)
![Status](https://img.shields.io/badge/Status-Draft-orange?style=for-the-badge)
![Agent](https://img.shields.io/badge/Agent-Docs-purple?style=for-the-badge)

<details open>
<summary><strong>📑 As-Built Cost Contents</strong></summary>

- [💵 Cost At-a-Glance](#-cost-at-a-glance)
- [✅ Decision Summary](#-decision-summary)
- [🔁 Requirements → Cost Mapping](#-requirements--cost-mapping)
- [📊 Top 5 Cost Drivers](#-top-5-cost-drivers)
- [🏛️ Architecture Overview](#%EF%B8%8F-architecture-overview)
- [🧾 What We Are Not Paying For (Yet)](#-what-we-are-not-paying-for-yet)
- [⚠️ Cost Risk Indicators](#%EF%B8%8F-cost-risk-indicators)
- [🎯 Quick Decision Matrix](#-quick-decision-matrix)
- [💰 Savings Opportunities](#-savings-opportunities)
- [🧾 Detailed Cost Breakdown](#-detailed-cost-breakdown)
- [References](#references)

</details>

> Generated by {agent} agent | {date}

<div align="center">

| ⬅️ Previous                                        | 📑 Index            | Next ➡️ |
| -------------------------------------------------- | ------------------- | ------- |
| [07-compliance-matrix.md](07-compliance-matrix.md) | [README](README.md) | —       |

</div>

**Generated**: {YYYY-MM-DD}
**Source**: Implemented Bicep Templates
**Region**: {primary-region}
**Environment**: {Production|Staging|Development}
**MCP Tools Used**: {azure_price_search, azure_cost_estimate, azure_bulk_estimate}
**IaC Reference**: {relative link to infra/bicep/{project}/, if available}

## 💵 Cost At-a-Glance

> **Monthly Total: ~$X,XXX** | Annual: ~$XX,XXX
>
> ```text
> Budget: {No fixed budget|$X/month (soft|hard)} | Utilization: {NN% ($X of $X)|N/A}
> ```
>
> | Status            | Indicator                    |
> | ----------------- | ---------------------------- |
> | Cost Trend        | ➡️ Stable                    |
> | Savings Available | 💰 $X/year with reservations |
> | Compliance        | ✅ {e.g., PCI-DSS aligned}   |

## ✅ Decision Summary

- ✅ Implemented: {what is in-scope and deployed}
- ⏳ Deferred: {what is explicitly not included yet}
- 🔁 Redesign Trigger: {what requirement change forces SKU/region redesign}

**Confidence**: {High|Medium|Low} | **Expected Variance**: ±{X}% ({1 sentence why})

### Design vs As-Built Summary

| Metric           | Design Estimate | As-Built | Variance    | Status       |
| ---------------- | --------------- | -------- | ----------- | ------------ |
| Monthly Estimate | ${X}            | ${X}     | {+$X / -$X} | ✅ / ⚠️ / ❌ |
| Annual Estimate  | ${X}            | ${X}     | {+$X / -$X} | ✅ / ⚠️ / ❌ |

![Design vs As-Built Cost Comparison](./07-ab-cost-comparison.png)

> Generate `07-ab-cost-comparison.png` using the pattern in `python-diagrams` skill →
> `references/waf-cost-charts.md` → **Chart 4 – Design vs As-Built Cost Comparison**.
> Replace placeholder costs with actual design estimate and as-built actuals.

## 🔁 Requirements → Cost Mapping

| Requirement           | Architecture Decision | Cost Impact    | Mandatory  |
| --------------------- | --------------------- | -------------- | ---------- |
| {SLA/RTO/RPO}         | {decision}            | {+$X/month}    | {Yes / No} |
| {Compliance}          | {decision}            | {+$X/month 📈} | {Yes / No} |
| {Latency/Performance} | {decision}            | {+$X/month}    | {Yes / No} |

## 📊 Top 5 Cost Drivers

| Rank | Resource        | Monthly Cost | % of Total | Trend | Optimization |
| ---- | --------------- | ------------ | ---------- | ----- | ------------ |
| 1️⃣   | {service / SKU} | ${X}         | {Y%}       | ➡️    | {action}     |
| 2️⃣   | {service / SKU} | ${X}         | {Y%}       | ➡️    | {action}     |
| 3️⃣   | {service / SKU} | ${X}         | {Y%}       | ➡️    | {action}     |
| 4️⃣   | {service / SKU} | ${X}         | {Y%}       | ➡️    | {action}     |
| 5️⃣   | {service / SKU} | ${X}         | {Y%}       | ➡️    | {action}     |

> 💡 **Quick Win**: {one low-effort action that saves meaningful cost}

<details>
<summary><strong>Cost Driver Details</strong></summary>

#### 1️⃣ {Top Driver Name}

| Aspect            | Detail                                  |
| ----------------- | --------------------------------------- |
| Current SKU       | {sku}                                   |
| Monthly Cost      | ${X}                                    |
| Cost Breakdown    | {compute: $X, storage: $Y, network: $Z} |
| Optimization      | {specific action to reduce cost}        |
| Potential Savings | ${X}/month with {RI/SP/right-sizing}    |

</details>

## 🏛️ Architecture Overview

### Cost Distribution

| Category         | Monthly Cost (USD) | Share |
| ---------------- | -----------------: | ----: |
| 💻 Compute       |                535 |   39% |
| 💾 Data Services |                466 |   34% |
| 🌐 Networking    |                376 |   27% |

![Monthly Cost Distribution](./07-ab-cost-distribution.png)

### Month-over-Month Projection

![6-Month Cost Projection](./07-ab-cost-projection.png)

> Generate `07-ab-cost-projection.png` using the pattern in `python-diagrams` skill →
> `references/waf-cost-charts.md` → **Chart 3 – Monthly Cost Projection**.
> Replace placeholder costs and months with actual as-built projected values.

### Key Design Decisions Affecting Cost

| Decision  | Cost Impact    | Business Rationale | Status                |
| --------- | -------------- | ------------------ | --------------------- |
| {example} | +$.../month 📈 | {why}              | {Required / Optional} |

## 🧾 What We Are Not Paying For (Yet)

- {Example: multi-region active-active}
- {Example: private endpoints for all services}
- {Example: premium HA cache}
- {Example: DDoS Standard}

## ⚠️ Cost Risk Indicators

| Resource        | Risk Level                     | Issue  | Mitigation   |
| --------------- | ------------------------------ | ------ | ------------ |
| {service / SKU} | {🔴 High / 🟡 Medium / 🟢 Low} | {risk} | {mitigation} |

> **⚠️ Watch Item**: {one sentence on biggest budget uncertainty}

## 🎯 Quick Decision Matrix

_"If you need X, expect to pay Y more"_

| Requirement                  | Additional Cost | SKU Change | Verdict                             | Notes   |
| ---------------------------- | --------------- | ---------- | ----------------------------------- | ------- |
| {Example: 99.99% SLA}        | +$.../month     | {SKU move} | 🟢 Go / 🟡 Monitor / 🔴 Investigate | {notes} |
| {Example: Private Endpoints} | +$.../month     | {config}   | 🟢 Go / 🟡 Monitor / 🔴 Investigate | {notes} |

## 💰 Savings Opportunities

<!-- Use ONE of the three states below. Delete the other two. -->

<!-- STATE 1: Quantified — use when RI/SP pricing was queried -->

> ### Total Potential Savings: ${X}/year
>
> | Strategy                | Commitment | Monthly Savings | Annual Savings | % Reduction |
> | ----------------------- | ---------- | --------------- | -------------- | ----------- |
> | Reserved Instances (RI) | 1-year     | ${...}          | ${...}         | {X%}        |
> | Reserved Instances (RI) | 3-year     | ${...}          | ${...}         | {X%}        |
> | Savings Plan (SP)       | 1-year     | ${...}          | ${...}         | {X%}        |
> | Right-sizing            | N/A        | ${...}          | ${...}         | {X%}        |
> | Dev/Test Pricing        | N/A        | ${...}          | ${...}         | {X%}        |

<!-- STATE 2: Not quantified — use when pricing run focused on baseline only -->

> ### Savings: Not Quantified in This Run
>
> This estimate covers baseline consumption pricing only. Reservation and
> commitment strategies should be evaluated once production workload patterns
> and SKU selections are confirmed.
>
> **Eligible strategies to evaluate**:
>
> | Strategy                | Applicability | Prerequisites                              |
> | ----------------------- | ------------- | ------------------------------------------ |
> | Reserved Instances (RI) | {✅ / ❌}     | {Stable baseline compute identified}       |
> | Savings Plan (SP)       | {✅ / ❌}     | {Committed compute spend confirmed}        |
> | Spot / Low Priority     | {✅ / ❌}     | {Fault-tolerant workloads identified}      |
> | Right-sizing            | {✅ / ❌}     | {Production utilization data available}    |
> | Dev/Test Pricing        | {✅ / ❌}     | {Non-production environments use dev SKUs} |

<!-- STATE 3: Not applicable — use for serverless/consumption-only designs -->

> ### Savings: Not Applicable
>
> This design uses consumption-based pricing exclusively. Commitment
> discounts do not apply to the selected service tiers.
> {Explain why — e.g., "All services are serverless with per-execution billing."}

## 🧾 Detailed Cost Breakdown

### IaC / Pricing Coverage

| Signal             | Value       | Status  |
| ------------------ | ----------- | ------- |
| Templates scanned  | {n}         | ✅      |
| Resources detected | {n}         | ✅      |
| Resources priced   | {n}         | ✅ / ⚠️ |
| Unpriced resources | {list or 0} | ✅ / ❌ |

### Line Items

| Category         | Service   | SKU / Meter | Quantity / Units | Est. Monthly |
| ---------------- | --------- | ----------- | ---------------- | ------------ |
| 💻 Compute       | {service} | {SKU}       | {qty}            | ${...}       |
| 💾 Data Services | {service} | {SKU}       | {qty}            | ${...}       |
| 🌐 Networking    | {service} | {meter}     | {qty}            | ${...}       |

### Notes

- {Call out price assumptions, gaps, and any known variances vs design}

---

## References

| Topic                    | Link                                                                                                                   |
| ------------------------ | ---------------------------------------------------------------------------------------------------------------------- |
| Azure Pricing Calculator | [Calculator](https://azure.microsoft.com/pricing/calculator/)                                                          |
| Cost Management          | [Overview](https://learn.microsoft.com/azure/cost-management-billing/costs/overview-cost-management)                   |
| Reserved Instances       | [Reservations](https://learn.microsoft.com/azure/cost-management-billing/reservations/save-compute-costs-reservations) |
| WAF Cost Optimization    | [Checklist](https://learn.microsoft.com/azure/well-architected/cost-optimization/checklist)                            |

---

<div align="center">

| ⬅️ [07-compliance-matrix.md](07-compliance-matrix.md) | 🏠 [Project Index](README.md) | ➡️ — |
| ----------------------------------------------------- | ----------------------------- | ---- |

</div>
