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

# vantage_cost_report (Resource)

> Terraform resource reference for vantage_cost_report (Resource). Auto-generated from the vantage-sh/terraform-provider-vantage repository.

<Note>
  This page is auto-generated based on the official [Terraform documentation](https://registry.terraform.io/providers/vantage-sh/vantage/latest/docs).
</Note>

## Overview

Use this resource with the [Vantage Terraform provider](/terraform). For installation and authentication, see the [Terraform provider quickstart](/terraform#quickstart). The schema below is generated directly from the provider source.

Manages a CostReport.

## Example Usage

```terraform theme={null}
resource "vantage_cost_report" "demo_report" {
  title               = "Demo Report"
  folder_token        = "fldr_3555785cd0409118"
  filter              = "costs.provider = 'aws'"
  saved_filter_tokens = ["svd_fltr_e844a2ccace05933", "svd_fltr_1b4b80a380ef4ba2"]
  workspace_token     = "wrkspc_47c3254c790e9351"
  chart_type          = "line" # Allowed: area, line, pie, bar, multi-bar
  date_bin            = "day"  # Allowed: cumulative, day, week, month, quarter

  settings = {
    include_credits      = true
    include_refunds      = true
    include_discounts    = true
    include_tax          = true
    amortize             = false
    unallocated          = false
    aggregate_by         = "cost" # Allowed: cost, usage, count
    show_previous_period = false
  }

  # optionally, use folder_token instead of workspace_token
  # folder_token = "fldr_47c3254c790e9351"
}
```

## Schema

### Required

* `title` (String) The title of the CostReport.

### Optional

* `business_metric_tokens_with_metadata` (Attributes List) The tokens for any BusinessMetrics to attach to the CostReport, and the unit scale. (see [below for nested schema](#nestedatt--business_metric_tokens_with_metadata))
* `chart_settings` (Attributes) Report chart settings. (see [below for nested schema](#nestedatt--chart_settings))
* `chart_type` (String) The chart type of the CostReport.
* `date_bin` (String) The date bin of the CostReport.
* `date_interval` (String) The date interval of the CostReport. Incompatible with 'start\_date' and 'end\_date' parameters. Defaults to 'this\_month' if start\_date and end\_date are not provided.
* `default_forecast` (Attributes) (see [below for nested schema](#nestedatt--default_forecast))
* `end_date` (String) The end date of the CostReport. ISO 8601 Formatted. Required when start\_date is provided. Incompatible with 'date\_interval' parameter.
* `filter` (String) The filter query language to apply to the CostReport. Additional documentation available at [https://docs.vantage.sh/vql](https://docs.vantage.sh/vql).
* `folder_token` (String) The token of the Folder to add the CostReport to. Determines the Workspace the report is assigned to.
* `groupings` (String) Grouping values for aggregating costs on the report. Valid groupings: account\_id, billing\_account\_id, charge\_type, cost\_category, cost\_subcategory, provider, region, resource\_id, service, tagged, usage\_unit, `tag:<tag_value>`. If providing multiple groupings, join as comma separated values: groupings=provider,service,region
* `previous_period_end_date` (String) The previous period end date of the CostReport. ISO 8601 Formatted. Required when previous\_period\_start\_date is provided.
* `previous_period_start_date` (String) The previous period start date of the CostReport. ISO 8601 Formatted.
* `saved_filter_tokens` (List of String) The tokens of the SavedFilters to apply to the CostReport.
* `settings` (Attributes) Report settings. (see [below for nested schema](#nestedatt--settings))
* `start_date` (String) The start date of the CostReport. ISO 8601 Formatted. Incompatible with 'date\_interval' parameter.
* `workspace_token` (String) The token of the Workspace to add the Cost Report to. Ignored if 'folder\_token' is set. Required if the API token is associated with multiple Workspaces.

### Read-Only

* `created_at` (String) The date and time, in UTC, the report was created. ISO 8601 Formatted.
* `id` (String) The id of the cost report
* `token` (String) The token of the cost report

<a id="nestedatt--business_metric_tokens_with_metadata" />

### Nested Schema for `business_metric_tokens_with_metadata`

Required:

* `business_metric_token` (String) The token of the BusinessMetric to attach to the CostReport.

Optional:

* `calculation_type` (String) The calculation type applied when this BusinessMetric is used in the CostReport.
* `label` (String) Optional custom display name for this BusinessMetric on the CostReport. When omitted, a default is derived from the calculation type.
* `label_filter` (List of String) Include only values with these labels in the CostReport.
* `label_filters` (Map of List of String) Include only ClickHouse BusinessMetric values matching every label key and one of its values.
* `unit_scale` (String) Determines the scale of the BusinessMetric's values within the CostReport.

<a id="nestedatt--chart_settings" />

### Nested Schema for `chart_settings`

Optional:

* `x_axis_dimension` (List of String) The dimension used to group or label data along the x-axis (e.g., by date, region, or service). NOTE: Only one value is allowed at this time. Defaults to \['date'].
* `y_axis_dimension` (String) The metric or measure displayed on the chart's y-axis. Possible values: 'cost', 'usage', 'count'. Defaults to 'cost'.

<a id="nestedatt--default_forecast" />

### Nested Schema for `default_forecast`

Required:

* `kind` (String) The default forecast selection kind.

Optional:

* `report_forecast_token` (String) The token for the report forecast selected as the default.

<a id="nestedatt--settings" />

### Nested Schema for `settings`

Optional:

* `aggregate_by` (String) Report will aggregate by cost, usage, or count.
* `amortize` (Boolean) Report will amortize.
* `complete_period` (Boolean) Report will restrict date ranges to completed periods only.
* `include_credits` (Boolean) Report will include credits.
* `include_discounts` (Boolean) Report will include discounts.
* `include_refunds` (Boolean) Report will include refunds.
* `include_tax` (Boolean) Report will include tax.
* `show_previous_period` (Boolean) Report will show previous period cost, usage, or count comparison.
* `unallocated` (Boolean) Report will show unallocated costs.


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