18. Cost Estimation and Resource Mapping
Cost breakdown and resource optimization for MILU2 Infrastructure.
Monthly Cost Drivers
┌─────────────────────────────────────────────────────────────────┐
│ Monthly Cost Drivers │
├─────────────────────────────────────────────────────────────────┤
│ │
│ ███████████████████████████ NAT Gateway (data transfer) │
│ █████████████████████ ECS Fargate/EC2 │
│ ████████████████ RDS Aurora Serverless │
│ ██████████████ CloudFront + WAF │
│ ████████████ Global Accelerator │
│ ██████████ ElastiCache + MemoryDB │
│ ████████ DocumentDB │
│ ██████ S3 + Lambda │
│ ████ KMS + CloudWatch │
│ │
└─────────────────────────────────────────────────────────────────┘
Compute Resources
| Resource | Type | Count | Monthly Est. |
|---|
| ECS Fargate API | 1 vCPU / 2GB | 1-8 | $35-280 |
| ECS Fargate Web | 1 vCPU / 2GB | 1-8 | $35-280 |
| ECS Fargate Admin | 1 vCPU / 2GB | 1 | $35 |
| ECS Fargate Push | 0.25 vCPU / 512MB | 1 | $11 |
| EC2 Bastion | t2.micro | 1 | $8 |
Database Resources
| Resource | Type | Config | Monthly Est. |
|---|
| RDS Aurora | Serverless v2 | 0.5-2 ACU | $45-180 |
| ElastiCache | cache.t4g.micro | 1 node | $13 |
| MemoryDB | db.t4g.small | 1 node | $50 |
| DocumentDB | Serverless | 1 instance | $45+ |
Cost Estimation by Environment
Test Environment (Minimal)
| Category | Monthly Cost |
|---|
| Compute | $100-150 |
| Database | $150-200 |
| Networking | $100-150 |
| CDN/Security | $50-100 |
| Storage | $20-50 |
| Total | $420-650 |
Production Environment (Full)
| Category | Monthly Cost |
|---|
| Compute | $500-1000 |
| Database | $500-1000 |
| Networking | $300-500 |
| CDN/Security | $200-500 |
| Storage | $100-300 |
| Total | $1600-3300 |
Cost Optimization Strategies
Compute Optimization
| Strategy | Savings | Implementation |
|---|
| Fargate Spot | Up to 70% | fargate_spot_weight > 0 |
| Right-size tasks | 10-30% | Monitor CPU/memory usage |
| Auto scaling | Variable | Already configured |
Database Optimization
| Strategy | Savings | Implementation |
|---|
| Auto-pause | Significant | Already enabled (5 min) |
| Fewer readers | $45+/mo | reader_count = 0 |
| Smaller ACU range | Variable | rds_min_capacity = 0.5 |
Monthly Cost Review Checklist
- ☐ Review Cost Explorer trends
- ☐ Check for unexpected spikes
- ☐ Verify auto-scaling worked correctly
- ☐ Review RDS auto-pause effectiveness
- ☐ Check NAT Gateway data transfer
- ☐ Review CloudFront cache hit ratio
- ☐ Check for unused resources
- ☐ Update cost forecasts