EC2 Rightsizing Report Script
Python script using Cost Explorer and CloudWatch metrics to identify over-provisioned EC2 instances with specific downsizing recommendations.
EC2 Rightsizing Report Script
Stop paying for instance size you are not using. This Python script cross-references Cost Explorer spend data with CloudWatch CPU and network metrics to pinpoint over-provisioned EC2 instances and recommend the exact instance type to downsize to — along with the projected monthly savings.
What Is Included
The script pulls 14 days of CloudWatch metrics per instance, computes average and peak utilization, and maps current instance types to cheaper alternatives in the same family. Output is a formatted table and an optional CSV report you can drop into a ticket or share with your team.
Developer Experience
- Single Python file — no framework, no dependencies beyond
boto3 - Runs in any environment with AWS credentials configured
- Configurable lookback window and utilization thresholds
- CSV export for easy copy-paste into budget reviews
What You Get
rightsizing_report.pyrequirements.txt.env.exampleREADME.md
Requirements
Python 3.10+, boto3, AWS credentials with Cost Explorer and CloudWatch read access. Cost Explorer must be enabled in the account (free tier: first million API calls/month).