如何在本機分析 AWS Cost Explorer CSV,毋須上載帳單或授予 IAM 權限
How to Analyze an AWS Cost Explorer CSV Locally (Without Uploading Your Bill or Granting IAM Access)
用戶可在瀏覽器本機分析 AWS Cost Explorer CSV,無須上載帳單、提供 AWS 憑證或設定 IAM 角色。按 Service 分組可查看服務費用概況,按 Usage type 分組則可定位具體費用項目,並據此安排唯讀 AWS CLI 檢查。需要資源層級歸因時,可改用啟用資源 ID 的 CUR 2.0 匯出;Bill Checkup 亦可在本機讀取相關檔案。
Most AWS cost tools ask you to set up a cross-account IAM role or upload your billing exports to a third-party backend. If you just want to figure out why last month's AWS bill jumped, that's a lot of friction—and a non-starter if your company restricts sharing raw billing data.
You can do the first pass locally in your browser: export a CSV from AWS Cost Explorer, open it in a client-side analyzer like Bill Checkup, and use the breakdown to decide which read-only AWS CLI checks to run next.
Quick tip before you export:
- Choose Group by → Service if you want a high-level view of which service leads your bill.
- Choose Group by → Usage type if you want exact charge line items (
NatGateway-Bytes,PublicIPv4:IdleAddress,EBS:VolumeUsage.gp2, etc.) and want automated cost-trap checks to run.
1. Export your costs from AWS Cost Explorer
- Open Billing and Cost Management → Cost Explorer in the AWS console using an account or role with billing read access.
- Pick the range and grouping that fit your question:
- Monthly review: Last complete month.
- Sudden bill spike: A few days before and after the jump, with Daily granularity.
- Grouping: Group by → Service for the overview, or Group by → Usage type to isolate specific charges.
- Click Download CSV (or Download as CSV in newer console views). Keep the date range, filters, and cost metric identical if you export both views to compare them.
Official reference: AWS Cost Explorer CSV download instructions
2. Open the CSV locally in your browser
Go to Bill Checkup and select Upload Cost Explorer / CUR CSV (or drag and drop the file).
- Raw billing rows stay on your device: The file is parsed inside a browser Web Worker. You can verify this yourself by opening DevTools → Network, clearing the log, and loading a CSV—or by switching the Network tab to Offline after the page loads and opening the CSV again (verification steps).
- No AWS credentials: No IAM role, no access keys, and no signup for local breakdowns.
- No CSV handy? Click Try with sample bill to load a synthetic 7-day export right away.
Why Top 10 usage types or Findings can be empty on a Service CSV
AWS Cost Explorer puts only one grouping dimension into each CSV. A file grouped by Service does not include usage-type tokens, so rule-based checks cannot match line items like NatGateway-Bytes or PublicIPv4:IdleAddress. If you started with Service, go back to Cost Explorer, optionally filter to your top service, switch Group by → Usage type, and open that second CSV.
3. Turn the biggest charge into a read-only next check
The built-in sample uses synthetic CUR 2.0 data covering 7 days ($396.25 net cost), so it populates both By service and Top 10 usage types together:
Here is how to turn those top rows into concrete, read-only follow-up checks:
| Where to look | Sample line item | What to check next |
|---|---|---|
By service / USE1-Host:ml.g5.xlarge
|
SageMaker — $212.52 | Run aws sagemaker list-endpoints in the billed Region and compare endpoint hours against invocation metrics. |
Top 10 usage types (USE1-NatGateway-Bytes) |
NAT Gateway data processing — $15.12 | Match spike days against deployments, container image pulls, or private-subnet S3/DynamoDB traffic. |
Top 10 usage types (USE1-NatGateway-Hours) |
NAT Gateway hours — $7.56 | Check how many gateways are provisioned across AZs and which route tables still point to them. |
Separating NatGateway-Bytes from NatGateway-Hours saves a lot of guesswork: if bytes spiked while hours stayed flat, check whether same-Region S3 or DynamoDB traffic is missing a free Gateway Endpoint. If you want to model that tradeoff quickly, you can also test numbers in the NAT Gateway Cost Calculator or read the full NAT Gateway troubleshooting guide.
4. When to switch from Cost Explorer CSV to CUR 2.0
Cost Explorer CSVs are the fastest way to narrow down a surprise charge, but Service and Usage type exports do not include resource IDs. When you need resource-level attribution—plus service, Region, and usage type in one file—create a CUR 2.0 standard data export with Include resource IDs enabled. Bill Checkup reads .csv and .csv.gz CUR 2.0 files locally too.
Originally published at billcheckup.fyi/blog/how-to-analyze-aws-cost-explorer-csv-locally. You can try the interactive sample bill here—and if you have a real-world AWS export quirk or missing cost rule, I'd love to hear about it in the comments.
來源:DEV Community · dev.to
