Loading...
Loading...
Analyze AWS costs, find savings, manage budgets, evaluate Savings Plans and Reserved Instances, right-size EC2/Lambda/RDS/EBS with Compute Optimizer, look up service pricing, query CUR with Athena, detect cost anomalies, scope costs to billing views, and monitor Free Tier usage. Triggers on: AWS bill, cost analysis, reduce spend, savings plan, reserved instance, right-size, budget alert, cost optimization, pricing, free tier, cost anomaly, CUR, cost audit, billing view, billing view ARN.
npx skill4agent add aws/agent-toolkit-for-aws aws-billing-and-cost-managementrun_scriptreferences/deterministic-calculations.md| Question | Tool | Reference |
|---|---|---|
| What am I spending? Where are costs going up? | Cost Explorer | |
| How much does a service cost? | Price List API | |
| Where can I save money? (start here) | Cost Optimization Hub | |
| Should I buy Savings Plans? | CE SP Recommendations | |
| Should I buy Reserved Instances? | CE RI Recommendations | |
| Deep-dive on a specific EC2/Lambda/EBS/RDS rec? | Compute Optimizer | |
| How do I set up budget alerts? | Budgets | |
| What's causing a cost spike? | Cost Anomaly Detection | |
| Am I within Free Tier? | Free Tier API | |
| How do I reduce my bill? | Cost Audit workflow | |
| How do I query detailed billing data? | CUR 2.0 + Athena | |
| How do I optimize specific services? | Per-service patterns | |
| How do I scope costs to a billing view? | Billing Views | See Billing Views below |
aws ce get-cost-and-usage \
--time-period Start=2026-03-01,End=2026-04-01 \
--granularity MONTHLY \
--metrics UnblendedCost \
--group-by Type=DIMENSION,Key=SERVICEUnblendedCost--filter '{"Not":{"Dimensions":{"Key":"RECORD_TYPE","Values":["Credit","Refund"]}}}'references/cost-audit.mdaws compute-optimizer update-enrollment-status --status Activereferences/ec2-rightsizing.mdreferences/pricing-lookup.md--billing-view-arnaws billing list-billing-views \
--billing-view-types PRIMARY CUSTOM BILLING_GROUPbilling:ListBillingViewsaws ce get-cost-and-usage \
--time-period Start=2026-03-01,End=2026-04-01 \
--granularity MONTHLY \
--metrics UnblendedCost \
--group-by Type=DIMENSION,Key=SERVICE \
--billing-view-arn arn:aws:billing::ACCOUNT_ID:billingview/BILLING_VIEW_ID--budgetBillingViewArnaws budgets create-budget --account-id ACCOUNT_ID \
--budget '{
"BudgetName": "TeamX-Monthly",
"BudgetLimit": {"Amount": "1000", "Unit": "USD"},
"TimeUnit": "MONTHLY",
"BudgetType": "COST",
"BillingViewArn": "arn:aws:billing::ACCOUNT_ID:billingview/BILLING_VIEW_ID"
}'--billing-view-arnSupports | Does NOT support it |
|---|---|
| |
| |
| |
| |
| |
| |
| |
|
| Error | Cause | Fix |
|---|---|---|
| Wrong dimension key (e.g., | Use |
| Empty results with filter | Filter value doesn't match exactly | Call |
| Hourly granularity not enabled | Enable in Cost Explorer preferences |
| Not opted in | Run |
| Budgets API fails outside us-east-1 | Budgets requires us-east-1 | Set |
Cost Explorer | By design — totals excluded when grouping | Make separate call without GroupBy, or sum grouped results using a script |
| Missing permission | User needs |
| API doesn't support billing views, or malformed ARN | Check the API support table above; ARN format is |
Budget shows | Billing view access revoked or view deleted | Check |