Format an AWS Usage Report for S3 charges to make it simpler to compare your usage to the public S3 Pricing page.
For example, the pricing page lists Tier 1 (i.e. PUT, COPY, POST, and LIST) requests at one cost and Tier 2 (GET, SELECT, and all others) requests at a different cost. However, the Usage Report lists requests by API call (e.g. GetObject, ListBucket, etc). This is a bit annoying, so this script parses them into their respective billing tiers.
- Navigate to AWS Billing. Select "Cost & usage reports" then "Create a usage report"
- Enter "Amazon Simple Storage Service" as the Service, "All usage types" for the Usage Type, "All Operations" for the Operations. Then select a time period and granularity.
- Download the report as a CSV.
- Run
tail -1 <FILE>
- if the output is "The report for the period and values you specified was too large..." then you must select a shorter time period or a larger granularity (or both) and redownload the file. - Run
python3 analyze_s3_usage_report.py <FILE>