How to build AWS cost dashboards in Metabase
AWS Billing is the billing and cost management layer of AWS — Cost Explorer, Budgets, Savings Plans, anomaly detection, and the Cost and Usage Report (CUR) that records every charge in your accounts. Metabase is where you turn that billing data into shared, trustworthy cost dashboards. This guide covers two complementary paths: a lightweight MCP + CLI route that pulls live cost data with the AWS Billing and Cost Management MCP Server and loads a CSV into Metabase with the Metabase CLI, and a durable pipeline route that lands AWS Billing cost data in a database so you can build dashboards anyone can read.
How do you connect AWS Billing to Metabase?
Most teams combine both routes: quick answers through MCP and CLI uploads first, then recurring cost reporting on a warehouse-backed model.
Live cost answers in, quick analysis out
Pair the AWS Billing and Cost Management MCP Server with the Metabase CLI. Use MCP for live cost lookups, write a scoped result to CSV, then load it into Metabase as a ready-to-query table and model.
- Quick questions such as "show me cloud spend overview by service and account"
- Loading AWS Billing cost exports into Metabase in seconds
- Spot-checks and one-off cost investigations without pipeline work
- Great for exploration, not governed month-end cost reporting
- Use read-only credentials or scoped API keys wherever supported
- CSV uploads are snapshots — refresh or move to the pipeline for history
Durable cost dashboards with history
Land AWS Billing cost data in a database or warehouse — via billing export, connector, or scheduled API pulls — then point Metabase at it.
- AWS Billing cost dashboards finance and engineering both trust
- Joining cost with revenue, customers, and usage for unit economics
- Long-run trends for cloud spend overview by service and account and commitment coverage and savings plans utilization
- You own the refresh schedule and the rollup grain
- Model amortized vs. unblended cost once, in the warehouse layer
- Tag and label hygiene decides how far allocation can go
What can you analyze from AWS Billing data in Metabase?
- Cloud spend overview by service and account — built from billing line items and the related daily cost rollups, Savings Plans and Reserved Instance commitments, budgets data your sync exposes.
- Commitment coverage and Savings Plans utilization — built from billing line items and the related daily cost rollups, Savings Plans and Reserved Instance commitments, budgets data your sync exposes.
- Cost anomalies and month-over-month drift — built from billing line items and the related daily cost rollups, Savings Plans and Reserved Instance commitments, budgets data your sync exposes.
- Cost allocation by team and tag — built from billing line items and the related daily cost rollups, Savings Plans and Reserved Instance commitments, budgets data your sync exposes.
- Unit economics: cost per customer or feature — built from billing line items and the related daily cost rollups, Savings Plans and Reserved Instance commitments, budgets data your sync exposes.
Which AWS cost dashboards should you build in Metabase?
Spend overview
Where the money goes, at a glance.
- Total spend this month vs. last (number + trend)
- Spend by service, top 10 (bar)
- Spend by account and environment (stacked bar)
- Daily spend with anomaly markers (line)
Commitments
Whether Savings Plans and RIs are earning their keep.
- Commitment coverage rate (number + trend)
- Savings Plans utilization (line)
- On-demand spend eligible for commitment (table)
- Upcoming commitment expirations (table)
Allocation
Which teams and workloads drive spend.
- Cost by team tag by month (stacked bar)
- Untagged spend rate (number + trend)
- Top cost-growing tags this month (table)
- Environment split: prod vs. non-prod (bar)
Trends and drift
The long-run spend picture against plan.
- Month-over-month growth by service (line)
- Budget burn vs. days elapsed (line)
- Anomalies detected and resolved (table)
- Cost per customer where unit data exists (line)
How do you use the AWS Billing and Cost Management MCP Server with the Metabase CLI?
Pair the AWS Billing and Cost Management MCP Server with the Metabase CLI for fast, hands-on cost analysis. MCP is useful for scoped lookups and summarized exports; the Metabase CLI's upload command loads CSV data into Metabase and creates a ready-to-query table and model.
Example workflow
- Ask the MCP server for last month's cost grouped by service and account, amortized — not raw billing line items.
- Export the result as CSV, keeping stable IDs, accounts, services, tags, and dates.
- Run
mb upload csvto load it into Metabase as a table and model, then build questions and dashboards on top.
Be honest about the limits
- MCP lookups are excellent for exploration, not scheduled reporting.
- A CSV upload is a snapshot; refresh it with
mb upload replaceor move to the pipeline for real history. - Complete months of line items are required for month-over-month trends, and amortized views need Savings Plans and RI data present.
mb upload csvneeds an uploads database configured under Admin → Settings → Uploads.
How do you set up AWS Billing MCP and the Metabase CLI?
AWS Billing and Cost Management MCP Serverofficial
- Transport
- Local server (uvx) over stdio
- Auth
- AWS credentials (AWS_PROFILE / IAM role)
- Best for
- Live scoped cost lookup and export
Metabase CLIofficial
- Install
npm install -g @metabase/cli- Auth
mb auth login- Load data
mb upload csv --file data.csv- Requires
- An uploads database (Admin → Settings → Uploads)
{
"mcpServers": {
"awslabs.billing-cost-management-mcp-server": {
"command": "uvx",
"args": ["awslabs.billing-cost-management-mcp-server@latest"],
"env": {
"AWS_PROFILE": "your-aws-profile",
"AWS_REGION": "us-east-1"
}
}
}
}This consolidated server (AWS Labs) covers Cost Explorer, Budgets, Compute Optimizer, and anomaly detection — the older awslabs.cost-explorer-mcp-server is deprecated; don't use it. Note that Cost Explorer API calls are billed at $0.01 per request, so keep MCP questions scoped and use Data Exports for bulk analysis.
# Install the Metabase CLI
npm install -g @metabase/cli
# Log in (opens your browser; requires Metabase v62+)
mb auth login --url https://your-metabase.example.com
# Load a billing-line-items export — creates a table AND a model
mb upload csv --file aws-billing-billing-line-items.csv --collection root
# Refresh that same table later from a new export
mb upload replace <table-id> --file aws-billing-billing-line-items.csvCan you generate a AWS Billing dashboard with AI?
Yes. Use the prompt below with any assistant that can run the AWS Billing and Cost Management MCP Server and the Metabase CLI. It works end to end: if AWS Billing cost tables already exist in Metabase it analyzes those; otherwise it pulls scoped, summarized data, loads it with mb upload csv, then builds the dashboard and caveats any metric that needs missing history.
Create a polished Metabase dashboard for AWS Billing cloud cost analytics.
Work end to end: get the data into Metabase if it isn't there yet, then build.
Goal: Help engineering, platform, and finance leaders understand total spend, service and account breakdowns, commitment coverage, tag allocation, and anomalies from AWS Billing data.
Step 1 — Find or load the data:
- First, check what already exists in Metabase (search for aws-billing tables and
models). If durable AWS Billing cost data is already present — a billing export,
warehouse sync, or earlier upload — use it and skip to Step 2.
- If nothing is there, pull a scoped, summarized export with the AWS Billing and Cost Management MCP Server:
billing line items, plus daily cost rollups, Savings Plans and Reserved Instance commitments, budgets.
Prefer daily rollups by service, account, team, or namespace over raw line
items. Write each result to a CSV, then load it with the Metabase CLI — run
"mb upload csv --file <export>.csv" so each upload creates a table and a
ready-to-query model. Use "mb upload replace <table-id> --file <export>.csv"
to refresh an existing table instead of creating duplicates.
Step 2 — Inspect before querying:
Do not assume exact table or column names. Inspect available fields, accounts,
services, tags or labels, and date ranges before creating trend cards.
Important:
- Build on whatever data is present; don't claim Metabase connects natively to
AWS Billing — it reads a database or CLI-uploaded tables.
- State whether costs are amortized, unblended, or net of credits — and never
mix conventions in one card.
- A single CSV is a point-in-time snapshot: only build trend cards if there is
a usable date column or multiple periods have been uploaded.
- Exclude or clearly separate credits, refunds, and taxes from usage cost.
- Only compute unit economics (cost per customer) when a customer-level
dimension or tag actually exists in the data.
Dashboard title: AWS Billing Cloud Cost Overview
Sections:
1. Executive summary: Spend this month; MoM growth; Commitment coverage;
Untagged spend rate; Anomalies open.
2. Spend: Cost by service and account by month; daily spend trend.
3. Commitments: Coverage and utilization; on-demand eligible spend; expirations.
4. Allocation: Cost by team tag; untagged spend; prod vs. non-prod.
5. Drift: MoM growth by service; budget burn; anomaly log.
Filters: Date range, Provider or Account, Service, Team, Environment, Tag.
Output: Build the dashboard if you have permission; otherwise provide the exact
questions, SQL, model definitions, and layout. Include caveats for any metric
that cannot be calculated from the available data.How do you sync AWS Billing data into a database or warehouse?
For dashboards that need history and reliability, land AWS Billing cost data in a database first, then connect Metabase to that database.
Connector options
- Billing export or managed ETL — use the vendor's native export or a connector when one covers the objects you need.
- Custom pipeline — use the AWS Data Exports (CUR 2.0) for control over rollup grain, fields, and refresh cadence.
- MCP + CSV — use this for quick exploration and one-off slices.
The durable path is AWS's own export pipeline, not a connector: create a Data Export (CUR 2.0) that delivers to S3, catalog it with Glue, and point Metabase's Amazon Athena driver at the table — resource-level line items with tags, amortization, and credits included.
Notes
- Decide the rollup grain first (daily per service, account, and team) — it drives warehouse cost and every trend card.
- Land raw billing tables first, then build clean Metabase models on top.
- Normalize account, service, team-tag, environment, usage-date, and amortized-cost fields.
How should you model AWS Billing data in Metabase?
Core tables
| Table | Grain | Key columns |
|---|---|---|
billing_line_items | one row per CUR 2.0 line item (resource per day) | usage_date, account_id, service, region, resource_id, usage_type, unblended_cost, amortized_cost, pricing_model, is_commitment_eligible, tags |
cost_daily_rollups | one row per service per account per day | usage_date, account_id, service, team, environment, amortized_cost_usd, unblended_cost_usd |
commitments | one row per Savings Plan or Reserved Instance | id, type, commitment_per_hour_usd, start_at, end_at, utilization_pct, coverage_scope |
Modeling advice
- Build a clean
cost_daily_rollupsmodel with common columns across clouds and tools, so multi-source dashboards don't fork definitions. - Keep amortized, unblended, and net-of-credits cost as separate, labeled columns — never let one card silently mix them.
- Treat tags and labels as slowly changing: they apply from when they were added, and historical spend stays untagged.
- Separate usage cost from credits, refunds, taxes, and support fees in the model layer, not in each card.
Which AWS cost metrics should you track in Metabase?
| Metric | Definition | Notes |
|---|---|---|
| Total cloud spend | Amortized cost per period across accounts and services. | Pick amortized or unblended once and label it. |
| Cost growth rate | Month-over-month change in spend, overall and by service. | Compare complete months; partial months mislead. |
| Commitment coverage rate | Commitment-covered spend over commitment-eligible spend. | Coverage and utilization are different failure modes. |
| Untagged spend rate | Spend with no team or owner tag over total spend. | The ceiling on every allocation dashboard. |
| Effective savings rate | Realized savings over what on-demand would have cost. | The single best commitment-program health number. |
What SQL powers AWS cost dashboards in Metabase?
These assume a cleaned analytical model in a warehouse (PostgreSQL dialect). Adjust table and column names to match your pipeline.
The headline spend view from daily rollups.
SELECT
date_trunc('month', usage_date) AS month,
service,
ROUND(SUM(amortized_cost_usd), 2) AS amortized_cost
FROM cost_daily_rollups
GROUP BY 1, 2
ORDER BY 1, amortized_cost DESC;Which services drive the trend, not just the total.
WITH monthly AS (
SELECT
date_trunc('month', usage_date) AS month,
service,
SUM(amortized_cost_usd) AS cost
FROM cost_daily_rollups
GROUP BY 1, 2
)
SELECT
month,
service,
cost,
ROUND(
100.0 * (cost - LAG(cost) OVER (PARTITION BY service ORDER BY month))
/ NULLIF(LAG(cost) OVER (PARTITION BY service ORDER BY month), 0), 1
) AS mom_growth_pct
FROM monthly
ORDER BY month DESC, cost DESC;Commitment-covered share of eligible spend.
SELECT
date_trunc('month', usage_date) AS month,
ROUND(
100.0 * SUM(amortized_cost) FILTER (WHERE pricing_model IN
('SavingsPlan', 'Reserved'))
/ NULLIF(SUM(amortized_cost) FILTER (WHERE is_commitment_eligible), 0), 1
) AS commitment_coverage_pct
FROM billing_line_items
GROUP BY 1
ORDER BY 1;