EC2 Decommission & Right-Sizing¶
🖥️ Instance Cost Optimization | Commands:
runbooks finops ec2-decommission-analysis,runbooks finops analyze-ec2
Overview¶
Identify idle, underutilized, and oversized EC2 instances with 4-way enrichment (cost, activity, scoring).
When to Use¶
| Scenario | Command | Savings Potential |
|---|---|---|
| Weekly Idle Instance Hunt | runbooks finops ec2-decommission-analysis --all-profiles --threshold 90 |
$2K-$4K/week |
| Instance Right-Sizing Review | runbooks finops analyze-ec2 --all-profiles |
$500-$1K per instance |
| EBS Snapshot Cleanup | runbooks finops ec2-snapshots --all-profiles |
$200-$500/month |
Usage Examples¶
Example 1: High-Confidence Decommission Targets (5 min)
runbooks finops ec2-decommission-analysis \
--all-profiles \
--threshold 90 \
--output-dir ./targets
# Output: targets/decommission-must.csv
# 12-15 instances with:
# - Cost/month (highest first)
# - Last activity (>30 days idle)
# - Confidence score (90-100 = safe to decommission)
# - Business case: $6.5K/month savings
Example 2: Right-Sizing Candidates (3 min)
runbooks finops analyze-ec2 \
--all-profiles \
--filter underutilized \
--min-monthly-cost 50
# Output: Instances with:
# - Current instance type (e.g., t3.2xlarge)
# - Recommended type (e.g., t3.large)
# - Monthly savings per instance ($200-$500)
# - Risk score (low = safe to resize)
Example 3: Snapshot Cost Audit (2 min)
runbooks finops ec2-snapshots \
--all-profiles \
--delete-unattached
# Output:
# - Orphaned snapshots identified: 250+ snapshots
# - Total waste: $800-$1200/month
# - Risk: None (unattached → safe to delete)
Enrichment Signals (E1-E7)¶
| Signal | Definition | Data Source |
|---|---|---|
| E1 | Monthly cost | AWS Cost Explorer API |
| E2 | CPU utilization | CloudWatch (14-day avg) |
| E3 | Network traffic | VPC Flow Logs (14-day sum) |
| E4 | EBS IOPS usage | CloudWatch metrics |
| E5 | Application logs | CloudWatch Logs (90-day check) |
| E6 | SSM Session activity | Systems Manager (90-day check) |
| E7 | Compute Optimizer recommendation | AWS Compute Optimizer API |
Related Commands¶
workspaces-decommission-analysis- Desktop/virtual desktop cleanupdetect-orphans- Cross-resource orphan detectionec2-snapshots- EBS snapshot cost optimization
MCP Validation¶
Decommission scoring validated at ≥99.5% accuracy using multi-signal confidence (E1-E7).
Average per-instance savings: $35-$150/month. Typical 10-15 targets per 100 instances.