ADR-027: xOps 3-Phase Cost Model
Status: Accepted Date: 2026-03-16 Deciders: @cloud-architect, HITL/Manager Sprint Goal: <=180/mo (Scenario 2 ceiling)
Context
The xOps sprint goal is RAG chatbot + Terraform at <=180/mo. HITL needs a per-phase cost model to:
- Confirm Scenario 1 (ECS Fargate, no Ollama) lands within the $100 intermediate target
- Confirm Scenario 2 (Scenario 1 + Ollama 8B) lands within the $180/mo sprint ceiling
- Identify deferred cost decisions that require HITL approval at deploy time
- Establish FOCUS 1.2+ FinOps tagging for cost attribution across 50+ accounts
Decision
Three-phase cost model adopted:
Phase 0: LOCAL ($0/mo)
Docker Compose stack. Full RAG pipeline offline. Validates all application logic before any AWS spend.
Phase 1: Scenario 1 - ECS Fargate ($78-94/mo)
| Component | Module | Spec | Monthly Cost |
|---|---|---|---|
| ECS Fargate | modules/ecs | ARM64 Graviton, 1 vCPU, 2 GB, 1 task | $30 |
| ALB | modules/web | 1 LB, HTTPS listener, health checks | $25 |
| CloudFront | modules/web | PriceClass_200, WebSocket bypass | $7-15 |
| WAFv2 (dual) | modules/web | REGIONAL + CLOUDFRONT, 2 managed rule groups | $6-12 |
| EFS | modules/efs | Bursting throughput, ~5 GB | $3 |
| KMS CMK | modules/kms | 1 key, auto-rotation | $1 |
| ECR | inline | ~2 GB image | $2 |
| CloudWatch | inline | /ecs/xops-dev, 90-day retention | $3-5 |
| Secrets Manager | inline | 1 secret | $1 |
| ACM | free | 2 certificates | $0 |
| Route53 | modules/web | 1 hosted zone + alias record | $0.50 |
| TOTAL Scenario 1 | $78-94/mo |
Scenario 1 uses Claude via API (SaaS). No local LLM on Fargate. 21x ROI vs $2k/mo SaaS equivalent.
Phase 2: Scenario 2 - Scenario 1 + Ollama 8B ($150-180/mo)
| Component | Delta from Scenario 1 | Spec | Monthly Cost |
|---|---|---|---|
| Scenario 1 baseline | - | As above | $78-94 |
| ECS Fargate (Ollama) | +1 task | 2 vCPU / 8 GB, ARM64 Graviton | +$72-86 |
| TOTAL Scenario 2 | $150-180/mo |
VPC Networking Decision (HITL-Pending)
Scenario 1 estimate does NOT include VPC networking. HITL decision required:
| Option | Cost | Trade-off |
|---|---|---|
| VPC Endpoints (S3, ECR, CW, SM) | +$28/mo | Recommended: no NAT, private subnet |
| NAT Gateway (1 AZ) | +$45/mo | HA risk: single AZ failure |
| NAT Gateway (2 AZ HA) | +$90/mo | Exceeds Scenario 1 $100 target |
Consequences
- Scenario 1 within $100 target with 6-22% headroom (VPC endpoints path)
- ARM64 Graviton provides ~20% compute cost reduction vs x86
- FOCUS 1.2+ tagging enables Cost Explorer org-wide attribution from day 1
- Ollama task independently scalable (cost-off when not in use)
References
accounts/xops/README.mdD4 Cost Breakdown (authoritative source)accounts/xops/environments/dev/dev.tfvarsFOCUS tag values- AWS Pricing Calculator (ap-southeast-2, 2026-03-16 rates)