> ## Documentation Index
> Fetch the complete documentation index at: https://docs.costory.io/llms.txt
> Use this file to discover all available pages before exploring further.

# GCP CUD Metadata

> Import GCP Committed Use Discount metadata from BigQuery into Costory.

> [tab] Terraform
>
> To install and authenticate the provider, see [Terraform setup](https://docs.costory.io/setup/terraform.md).
>
> ```hcl theme={null}
> terraform {
>   required_providers {
>     costory = {
>       source  = "costory-io/costory"
>       version = ">= 0.1.0"
>     }
>   }
> }
>
> variable "costory_api_token" {
>   type        = string
>   description = "Costory API token."
>   sensitive   = true
> }
>
> provider "costory" {
>   token = var.costory_api_token
> }
>
> resource "costory_billing_datasource_gcp_cud_export" "main" {
>   name          = "GCP CUD Export"
>   bq_table_path = "my-project.billing.cud_export"
> }
> ```

> [tab] Manual setup
>
> Open Costory and go to **Billing > Import new billing datasource > GCP CUD Metadata**. The stepper guides you through each field.
>
> 1. Export GCP Committed Use Discount metadata to BigQuery.
> 2. Ensure the table includes required columns:
>    * billing\_account\_id, cud\_product, consumption\_model, subscription, region,
>      term, start\_time, end\_time, state
> 3. Provide the BigQuery table path in the Costory stepper.
>
> Reference:\
> [https://cloud.google.com/billing/docs/how-to/export-data-bigquery-tables/cud-export](https://cloud.google.com/billing/docs/how-to/export-data-bigquery-tables/cud-export)

**What Costory includes**

* **Commitment metadata**: billing account, product, region, term, start/end dates, and state.
* **Consumption model and subscription type** for each commitment.

**What Costory does not include**

* **Commitment cost or savings data**. This datasource provides metadata only. Actual CUD cost impact is captured in the [GCP billing export](https://docs.costory.io/setup/billing/gcp.md).
* No historical backfill. Costory imports the current state of the BigQuery table.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.