FOCUS cloud costs
Normalizes AWS, Azure and Google Cloud billing exports into the FinOps FOCUS schema
- Connector software
- Free and open source
- Service credentials
- Not needed
- Query Farm hosting
- Available · $10/month organization minimum
Use with an agent
Install the Orchard skill in your project to help your agent find connectors, configure them, and verify SQL results.
npx skills add Query-farm/vgi-skills --skill orchard
Copy this request into your coding agent to get started.
Use https://query.farm/products/orchard/connectors/focus-cost/index.md to help me query FOCUS cloud costs with DuckDB or Haybarn 2.0.1 and VGI protocol 3.4. Ask only for missing details about the result I need or whether I want local execution, self-hosting or Query Farm hosting. Check the connector's actual hosting availability, credentials and input requirements. Read one format of each needed reference and the exact object declarations before writing SQL. Use a released connector, and distinguish a saved example result from anything you actually execute. If you cannot run the query, tell me what remains to verify.
Compare cloud spending across AWS, Azure and Google Cloud
Uses the connector’s bundled sample billing exports from AWS, Azure and Google Cloud.
Example output · captured
- Connector release
- v0.2.0
- Engine
- 2.0.1
- VGI protocol
- 3.4.0
SELECT ProviderName, ServiceCategory, sum(EffectiveCost) AS effective_cost
FROM (SELECT * FROM focus.main.focus('sample://aws_cur2') UNION ALL SELECT * FROM focus.main.focus('sample://azure/contoso-actual-cost-202607.csv') UNION ALL SELECT * FROM focus.main.focus('sample://gcp/gcp_billing_export_v1_01A2B3_202607.parquet'))
GROUP BY ALL
ORDER BY effective_cost DESC
| ProviderName | ServiceCategory | effective_cost |
|---|---|---|
| AWS | Compute | 377.54 |
| Google Cloud | Other | 318.75 |
| AWS | Other | 300 |
| AWS | Databases | 262.25 |
| Google Cloud | Compute | 220.86 |
Quick start
Choose where to run FOCUS cloud costs, then follow the steps below.
The connector runs alongside DuckDB or Haybarn. No Query Farm account is needed.
1. Install the vgi extension
Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.
SET allow_extension_repositories = 'allowed';
CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
WITH PREFIX 'https://duckdb-extensions.query.farm';
INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;
INSTALL vgi FROM community;
LOAD vgi;
2. Attach the connector
Attach with uvx
Needs uv. uvx builds the worker from its release tag on first attach and reuses the cached environment after that.
ATTACH 'focus' AS focus (
TYPE vgi,
LOCATION 'uvx --from git+https://github.com/Query-farm/[email protected] vgi-focus-worker'
);
Attach the signed image
Needs Docker, Podman or another OCI runtime. The extension runs the container and talks to it over stdio.
ATTACH 'focus' AS focus (
TYPE vgi,
LOCATION 'oci://ghcr.io/query-farm/vgi-focus-cost:0.2.0'
);
3. Run a query
SELECT ProviderName, ServiceCategory, sum(EffectiveCost) AS effective_cost
FROM (SELECT * FROM focus.main.focus('sample://aws_cur2') UNION ALL SELECT * FROM focus.main.focus('sample://azure/contoso-actual-cost-202607.csv') UNION ALL SELECT * FROM focus.main.focus('sample://gcp/gcp_billing_export_v1_01A2B3_202607.parquet'))
GROUP BY ALL
ORDER BY effective_cost DESC
Run the connector on a server you manage. You operate the service and choose who can connect.
1. Deploy the connector on your server
Follow the connector’s deployment instructions. Use its supported HTTP transport, or launch it remotely over SSH. The connection guide explains both options.
2. Install the vgi extension
Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.
SET allow_extension_repositories = 'allowed';
CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
WITH PREFIX 'https://duckdb-extensions.query.farm';
INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;
INSTALL vgi FROM community;
LOAD vgi;
3. Attach the connector
For an HTTP deployment, replace the example URL with your endpoint. Add the authentication options your deployment requires. For SSH, use the SSH connection instructions.
ATTACH 'focus' AS focus
(TYPE vgi, LOCATION 'https://your-connector.example.com');
4. Run a query
SELECT ProviderName, ServiceCategory, sum(EffectiveCost) AS effective_cost
FROM (SELECT * FROM focus.main.focus('sample://aws_cur2') UNION ALL SELECT * FROM focus.main.focus('sample://azure/contoso-actual-cost-202607.csv') UNION ALL SELECT * FROM focus.main.focus('sample://gcp/gcp_billing_export_v1_01A2B3_202607.parquet'))
GROUP BY ALL
ORDER BY effective_cost DESC
Query Farm operates FOCUS cloud costs for your team. Hosting has a $10 monthly minimum per organization; usage counts toward it. From $2.97 per instance-month ($10 monthly minimum).
1. Create your hosted connector
Open the console, choose your organization and deployment size, and add any service credentials there.
2. Install the vgi extension
SET allow_extension_repositories = 'allowed';
CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
WITH PREFIX 'https://duckdb-extensions.query.farm';
INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;
INSTALL vgi FROM community;
LOAD vgi;
3. Attach your deployment
Copy the ATTACH statement from your deployment in the console and run it in DuckDB or Haybarn. Use focus as the catalog alias for the query below.
4. Run a query
SELECT ProviderName, ServiceCategory, sum(EffectiveCost) AS effective_cost
FROM (SELECT * FROM focus.main.focus('sample://aws_cur2') UNION ALL SELECT * FROM focus.main.focus('sample://azure/contoso-actual-cost-202607.csv') UNION ALL SELECT * FROM focus.main.focus('sample://gcp/gcp_billing_export_v1_01A2B3_202607.parquet'))
GROUP BY ALL
ORDER BY effective_cost DESC
Technical details
- Verified connector release
- v0.2.0
- Engine
- 2.0.1
- VGI protocol
- 3.4.0
- Verified on
- December 1, 2026
Pin a version for production
When running the connector yourself, keep a specific release until you’re ready to upgrade. Replace the ATTACH statement above with this one and follow the same extension and credential setup.
Attach with uvx
Needs uv. uvx builds the worker from its release tag on first attach and reuses the cached environment after that.
ATTACH 'focus' AS focus (
TYPE vgi,
LOCATION 'uvx --from git+https://github.com/Query-farm/[email protected] vgi-focus-worker'
);
Attach the signed image
Needs Docker, Podman or another OCI runtime. The extension runs the container and talks to it over stdio.
ATTACH 'focus' AS focus (
TYPE vgi,
LOCATION 'oci://ghcr.io/query-farm/vgi-focus-cost:0.2.0'
);
Overview
Normalize AWS, Azure and Google Cloud billing exports into the FinOps FOCUS 1.x schema, so one DuckDB query covers every cloud, with exact decimal money and conformance checks.
Turn AWS, Azure and Google Cloud billing exports into the FinOps Foundation's FOCUS schema inside DuckDB: one query, every cloud.
- Readers for AWS CUR 2.0, Azure cost exports, GCP billing export dumps and native FOCUS files.
- Exact money:
DECIMAL(19,6), neverDOUBLE, rounded half-to-even. - Auditable: every mapping rule is a row you can query.
- Conformance: check any FOCUS file against the spec.
FOCUS column definitions are © FinOps Open Cost and Usage Specification (FOCUS) Series contributors, used under CC BY 4.0.
Catalog
Everything focus exposes once attached — read straight from the worker's
released build.
main 4 tables · 10 functions
FOCUS readers, mapping, validation, reference tables and exact-arithmetic scalars.
Schema examples (13)
Amortized spend by cloud and service category across AWS, Azure and GCP exports
SELECT ProviderName, ServiceCategory, sum(EffectiveCost) AS effective_cost
FROM (SELECT * FROM focus.main.focus('sample://aws_cur2') UNION ALL SELECT * FROM focus.main.focus('sample://azure/contoso-actual-cost-202607.csv') UNION ALL SELECT * FROM focus.main.focus('sample://gcp/gcp_billing_export_v1_01A2B3_202607.parquet'))
GROUP BY ALL
ORDER BY effective_cost DESC;
| ProviderName | ServiceCategory | effective_cost |
|---|---|---|
| AWS | Compute | 377.54 |
| Google Cloud | Other | 318.75 |
| AWS | Other | 300 |
| AWS | Databases | 262.25 |
| Google Cloud | Compute | 220.86 |
July invoice cost by team tag in the AWS CUR 2.0 sample
SELECT Tags['team'] AS team, sum(BilledCost) AS billed
FROM focus.main.focus('sample://aws_cur2', billing_period := '2026-07')
WHERE Tags['team'] IS NOT NULL
GROUP BY team
ORDER BY billed DESC;
Map raw CUR 2.0 rows written inline to FOCUS
SELECT ChargeCategory, CommitmentDiscountStatus, BilledCost, EffectiveCost
FROM focus.main.to_focus((SELECT * FROM (VALUES ('Usage', 1.9584, NULL, NULL), ('SavingsPlanCoveredUsage', 3.9168, 2.7408, 'arn:aws:savingsplans::1:savingsplan/x')) AS t(line_item_line_item_type, line_item_unblended_cost, savings_plan_savings_plan_effective_cost, savings_plan_savings_plan_a_r_n)))
ORDER BY BilledCost;
Checks a native FOCUS 1.2 export does not pass as FOCUS 1.3
SELECT check_name, column_name, status
FROM focus.main.focus_validate('sample://focus12', spec_version := '1.3')
WHERE status <> 'pass'
ORDER BY check_name, column_name;
9 more examples
Error-level checks of the mapped GCP billing export sample
SELECT check_name, column_name, failing_rows, sample_value
FROM focus.main.focus_validate('sample://gcp/gcp_billing_export_v1_01A2B3_202607.parquet')
WHERE severity = 'error'
ORDER BY failing_rows DESC, check_name;
Classify EC2
SELECT focus.main.focus_service_category('aws', 'AmazonEC2') AS category;
Classify Cosmos DB
SELECT focus.main.focus_service_subcategory('azure', 'Azure Cosmos DB') AS subcategory;
AWS reserved-instance fee
SELECT focus.main.focus_charge_category('aws', 'RIFee') AS category;
Where GCP list cost goes
SELECT focus.main.focus_map_column('gcp', 'cost_at_list') AS focus_columns;
An invalid ChargeFrequency
SELECT focus.main.focus_validate_value('ChargeFrequency', 'Monthly') AS problem;
A lower-case ChargeCategory is rejected by FOCUS 1.0
SELECT focus.main.focus_validate_value('ChargeCategory', 'usage', '1.0') AS problem;
Effective-to-list cost ratio of the AWS sample without DOUBLE rounding
SELECT focus.main.focus_divide(sum(EffectiveCost), sum(ListCost)) AS effective_over_list
FROM focus.main.focus('sample://aws_cur2');
Effective rate per resource in the AWS sample
SELECT ResourceId,
focus.main.focus_effective_rate(sum(EffectiveCost), sum(PricingQuantity)) AS rate
FROM focus.main.focus('sample://aws_cur2')
WHERE ChargeCategory = 'Usage' AND ResourceId IS NOT NULL
GROUP BY ResourceId
ORDER BY rate DESC;
charge_type_map
Provider charge types -> FOCUS ChargeCategory (and ChargeFrequency for AWS).
AWS line item types that are FOCUS purchases
SELECT charge_type, charge_frequency
FROM focus.main.charge_type_map
WHERE source = 'aws_cur2' AND charge_category = 'Purchase'
ORDER BY charge_type;
focus_columns
The FOCUS specification's Cost and Usage columns for versions 1.0 to 1.4 (CC BY 4.0, FinOps Foundation).
Allowed ChargeCategory values in FOCUS 1.2
SELECT unnest(allowed_values) AS v
FROM focus.main.focus_columns
WHERE spec_version = '1.2' AND column_name = 'ChargeCategory'
ORDER BY v;
Columns added in FOCUS 1.3
SELECT column_name
FROM focus.main.focus_columns
WHERE spec_version = '1.3' AND column_name NOT IN (SELECT column_name FROM focus.main.focus_columns WHERE spec_version = '1.2')
ORDER BY column_name;
provider_map
How every FOCUS column is derived from each provider's export: the auditable mapping rules.
Where AWS EffectiveCost comes from
SELECT len(source_columns) AS inputs, filter_pushdown
FROM focus.main.provider_map
WHERE source = 'aws_cur2' AND focus_column = 'EffectiveCost';
Columns pushed into the Parquet scan per source
SELECT source, count(*) FILTER (WHERE filter_pushdown) AS pushed
FROM focus.main.provider_map
WHERE source <> 'focus'
GROUP BY source
ORDER BY source;
service_map
Curated provider service -> FOCUS ServiceName, ServiceCategory and ServiceSubcategory.
Database services per provider
SELECT provider, count(*) AS services
FROM focus.main.service_map
WHERE service_category = 'Databases'
GROUP BY provider
ORDER BY provider;
focus_charge_category (provider VARCHAR, charge_type VARCHAR)
FOCUS ChargeCategory for a raw provider charge type, e.g. ('aws', 'RIFee') -> 'Purchase'
AWS reserved-instance fee
SELECT focus.main.focus_charge_category('aws', 'RIFee') AS category;
SELECT focus.main.focus_charge_category(p, t) AS c
FROM (VALUES ('aws', 'SavingsPlanCoveredUsage', 1), ('azure', 'Purchase', 2), ('gcp', 'tax', 3)) v(p, t, i)
ORDER BY i;
focus_divide (numerator DECIMAL(38,10), denominator DECIMAL(38,10))
Exact decimal division to DECIMAL(19,10), half-even; NULL on a zero or NULL denominator
Effective-to-list cost ratio of the AWS sample without DOUBLE rounding
SELECT focus.main.focus_divide(sum(EffectiveCost), sum(ListCost)) AS effective_over_list
FROM focus.main.focus('sample://aws_cur2');
SELECT focus.main.focus_divide(10, 3) AS r,
focus.main.focus_divide(1, 0) AS z;
focus_effective_rate (cost DECIMAL(38,10), quantity DECIMAL(38,10))
Exact unit rate cost / quantity as DECIMAL(19,10); NULL when quantity is 0 or NULL
Effective rate per resource in the AWS sample
SELECT ResourceId,
focus.main.focus_effective_rate(sum(EffectiveCost), sum(PricingQuantity)) AS rate
FROM focus.main.focus('sample://aws_cur2')
WHERE ChargeCategory = 'Usage' AND ResourceId IS NOT NULL
GROUP BY ResourceId
ORDER BY rate DESC;
SELECT focus.main.focus_effective_rate(2.7408, 24) AS rate;
focus_map_column (source VARCHAR, source_column VARCHAR)
Which FOCUS columns a raw export column feeds, e.g. ('aws_cur2', 'line_item_unblended_cost')
Where GCP list cost goes
SELECT focus.main.focus_map_column('gcp', 'cost_at_list') AS focus_columns;
SELECT focus.main.focus_map_column('aws_cur2', 'lineItem/UnblendedCost') AS cols;
SELECT focus.main.focus_map_column('azure', 'CostCenter') IS NULL AS unused;
focus_service_category (provider VARCHAR, service VARCHAR)
FOCUS ServiceCategory for a provider service, e.g. ('aws', 'AmazonEC2') -> 'Compute'
Classify EC2
SELECT focus.main.focus_service_category('aws', 'AmazonEC2') AS category;
SELECT focus.main.focus_service_category(p, s) AS c
FROM (VALUES ('aws', 'AmazonRDS', 1), ('azure', 'Virtual Machines', 2), ('gcp', 'Cloud Storage', 3), ('aws', 'NotAService', 4)) t(p, s, i)
ORDER BY i;
focus_service_subcategory (provider VARCHAR, service VARCHAR)
FOCUS ServiceSubcategory for a provider service, e.g. ('aws', 'AmazonRDS') -> 'Relational Databases'
Classify Cosmos DB
SELECT focus.main.focus_service_subcategory('azure', 'Azure Cosmos DB') AS subcategory;
SELECT focus.main.focus_service_subcategory('aws', 'AmazonRDS') AS a,
focus.main.focus_service_subcategory('gcp', 'Cloud Run') AS b;
focus_validate_value (column_name VARCHAR, value VARCHAR, spec_version VARCHAR) +1 overload
NULL if a value is legal for a FOCUS 1.2 column, else the violation text
focus_validate_value(column_name VARCHAR, value VARCHAR) → VARCHARfocus_validate_value(column_name VARCHAR, value VARCHAR, spec_version VARCHAR) → VARCHAR
An invalid ChargeFrequency
SELECT focus.main.focus_validate_value('ChargeFrequency', 'Monthly') AS problem;
A lower-case ChargeCategory is rejected by FOCUS 1.0
SELECT focus.main.focus_validate_value('ChargeCategory', 'usage', '1.0') AS problem;
SELECT focus.main.focus_validate_value('ServiceProviderName', 'AWS', '1.2') AS v12,
focus.main.focus_validate_value('ServiceProviderName', 'AWS', '1.3') AS v13;
focus (path VARCHAR, billing_period := VARCHAR, file_format := VARCHAR, money_scale := BIGINT, source := VARCHAR, spec_version := VARCHAR)
Read AWS, Azure, GCP or native FOCUS billing export files as typed FOCUS 1.x rows
Amortized spend by cloud and service category across AWS, Azure and GCP exports
SELECT ProviderName, ServiceCategory, sum(EffectiveCost) AS effective_cost
FROM (SELECT * FROM focus.main.focus('sample://aws_cur2') UNION ALL SELECT * FROM focus.main.focus('sample://azure/contoso-actual-cost-202607.csv') UNION ALL SELECT * FROM focus.main.focus('sample://gcp/gcp_billing_export_v1_01A2B3_202607.parquet'))
GROUP BY ALL
ORDER BY effective_cost DESC;
| ProviderName | ServiceCategory | effective_cost |
|---|---|---|
| AWS | Compute | 377.54 |
| Google Cloud | Other | 318.75 |
| AWS | Other | 300 |
| AWS | Databases | 262.25 |
| Google Cloud | Compute | 220.86 |
July invoice cost by team tag in the AWS CUR 2.0 sample
SELECT Tags['team'] AS team, sum(BilledCost) AS billed
FROM focus.main.focus('sample://aws_cur2', billing_period := '2026-07')
WHERE Tags['team'] IS NOT NULL
GROUP BY team
ORDER BY billed DESC;
SELECT ChargeCategory, sum(BilledCost) AS billed,
sum(EffectiveCost) AS effective
FROM focus.main.focus('sample://aws_cur2', billing_period := '2026-07')
GROUP BY ChargeCategory
ORDER BY ChargeCategory;
focus_validate (path VARCHAR, file_format := VARCHAR, source := VARCHAR, spec_version := VARCHAR)
Check billing export files against the FOCUS spec: required columns, nulls, allowed values
Checks a native FOCUS 1.2 export does not pass as FOCUS 1.3
SELECT check_name, column_name, status
FROM focus.main.focus_validate('sample://focus12', spec_version := '1.3')
WHERE status <> 'pass'
ORDER BY check_name, column_name;
Error-level checks of the mapped GCP billing export sample
SELECT check_name, column_name, failing_rows, sample_value
FROM focus.main.focus_validate('sample://gcp/gcp_billing_export_v1_01A2B3_202607.parquet')
WHERE severity = 'error'
ORDER BY failing_rows DESC, check_name;
to_focus (data TABLE, money_scale := BIGINT, source := VARCHAR, spec_version := VARCHAR)
Map raw AWS, Azure, GCP or FOCUS billing rows from any DuckDB query to typed FOCUS rows
Map raw CUR 2.0 rows written inline to FOCUS
SELECT ChargeCategory, CommitmentDiscountStatus, BilledCost, EffectiveCost
FROM focus.main.to_focus((SELECT * FROM (VALUES ('Usage', 1.9584, NULL, NULL), ('SavingsPlanCoveredUsage', 3.9168, 2.7408, 'arn:aws:savingsplans::1:savingsplan/x')) AS t(line_item_line_item_type, line_item_unblended_cost, savings_plan_savings_plan_effective_cost, savings_plan_savings_plan_a_r_n)))
ORDER BY BilledCost;
Try these queries
July invoice cost by team tag in the AWS CUR 2.0 sample
SELECT Tags['team'] AS team, sum(BilledCost) AS billed
FROM focus.main.focus('sample://aws_cur2', billing_period := '2026-07')
WHERE Tags['team'] IS NOT NULL
GROUP BY team
ORDER BY billed DESC
Uses focus
Map raw CUR 2.0 rows written inline to FOCUS
SELECT ChargeCategory, CommitmentDiscountStatus, BilledCost, EffectiveCost
FROM focus.main.to_focus((SELECT * FROM (VALUES ('Usage', 1.9584, NULL, NULL), ('SavingsPlanCoveredUsage', 3.9168, 2.7408, 'arn:aws:savingsplans::1:savingsplan/x')) AS t(line_item_line_item_type, line_item_unblended_cost, savings_plan_savings_plan_effective_cost, savings_plan_savings_plan_a_r_n)))
ORDER BY BilledCost
Uses to_focus
Checks a native FOCUS 1.2 export does not pass as FOCUS 1.3
SELECT check_name, column_name, status
FROM focus.main.focus_validate('sample://focus12', spec_version := '1.3')
WHERE status <> 'pass'
ORDER BY check_name, column_name
Uses focus_validate
Classify EC2
SELECT focus.main.focus_service_category('aws', 'AmazonEC2') AS category
Classify Cosmos DB
SELECT focus.main.focus_service_subcategory('azure', 'Azure Cosmos DB') AS subcategory
AWS reserved-instance fee
SELECT focus.main.focus_charge_category('aws', 'RIFee') AS category
21 more examples in the Catalog, each listed under the table or function it uses.
Questions it can answer
Plain-English questions from the worker's agent test tasks. An AI agent with this catalog attached should answer each one with SQL.
- The bundled Azure sample sample://azure/contoso-amortized-cost-202607.parquet is an amortized-cost export. What is its effective cost per FOCUS ServiceCategory?
- Validate the bundled native FOCUS 1.2 export sample://focus12 against FOCUS 1.3. Which checks are not passing? Give check name, column and status.
- How many columns does FOCUS version 1.2 define as Mandatory?
- Which raw AWS CUR 2.0 columns does the focus worker read to compute EffectiveCost?
- How many Azure services in the focus worker's service classification map to the Databases category?
- Which AWS line item types does the focus worker classify as the FOCUS Credit charge category?
FOCUS cloud costs is an independent open-source connector from Query.Farm. It is not affiliated with, endorsed by or sponsored by the services, projects or organisations it works with. Product names, logos and trademarks belong to their respective owners.
Related workers
Cloudflare
Cloud & infrastructure
Query your Cloudflare accounts, zones, DNS, security, and analytics as SQL tables
Hue typescript
Cloud & infrastructure
Read and control Philips Hue lights, rooms, scenes and sensors from SQL
Kubernetes
Cloud & infrastructure
A live Kubernetes cluster's pods, nodes, workloads, events, RBAC, logs and custom resources as SQL