> ## 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_virtual_tag_config (Resource)

> Terraform resource reference for vantage_virtual_tag_config (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.

## Example Usage

```terraform theme={null}
data "vantage_virtual_tag_configs" "demo" {}
resource "vantage_virtual_tag_config" "demo_virtual_tag_config" {
  key            = "Demo Tag"
  backfill_until = "2024-01-01"
  overridable    = true
  values = [
    {
      name   = "Demo Value 0"
      filter = "(costs.provider = 'aws' AND costs.region = 'us-east-1') OR (costs.provider = 'gcp' AND costs.region = 'us-central1')"
    },
    {
      filter = "(costs.provider = 'aws' AND costs.service = 'AwsApiGateway')"
      cost_metric = {
        aggregation = {
          tag = "environment"
        }
        filter = "(costs.provider = 'aws' AND costs.service = 'AmazonECS')"
      }
    },
    # {
    #   filter = "(costs.provider = 'aws' AND costs.service = 'AmazonECS')"
    #   business_metric_token = ""
    # }
  ]
}
```

## Schema

### Required

* `key` (String) The key of the VirtualTagConfig.
* `overridable` (Boolean) Whether the VirtualTagConfig can override a provider-supplied tag on a matching Cost.

### Optional

* `backfill_until` (String) The earliest month the VirtualTagConfig should be backfilled to.
* `collapsed_tag_keys` (Attributes List) Tag keys to collapse values for. (see [below for nested schema](#nestedatt--collapsed_tag_keys))
* `values` (Attributes List) Values for the VirtualTagConfig, with match precedence determined by order in the list. (see [below for nested schema](#nestedatt--values))

### Read-Only

* `created_by_token` (String) The token of the Creator of the VirtualTagConfig.
* `id` (String) The id of the VirtualTagConfig.
* `token` (String) The token of the VirtualTagConfig.

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

### Nested Schema for `collapsed_tag_keys`

Required:

* `key` (String) The tag key to collapse values for.

Optional:

* `filter` (String) The VQL filter this collapsed tag key applies to.
* `providers` (List of String) The providers this collapsed tag key applies to. Defaults to all providers.

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

### Nested Schema for `values`

Required:

* `filter` (String) The filter query language to apply to the value. Additional documentation available at [https://docs.vantage.sh/vql](https://docs.vantage.sh/vql).

Optional:

* `business_metric_token` (String) The token of an associated business metric.
* `cost_metric` (Attributes) (see [below for nested schema](#nestedatt--values--cost_metric))
* `date_ranges` (Attributes List) Date ranges restricting when this value applies. Each range has optional start\_date and end\_date (inclusive, YYYY-MM-DD). (see [below for nested schema](#nestedatt--values--date_ranges))
* `label_transforms` (Attributes List) Label transforms applied to business metric labels. (see [below for nested schema](#nestedatt--values--label_transforms))
* `name` (String) The name of the value.
* `percentages` (Attributes List) Labeled percentage allocations for matching costs. (see [below for nested schema](#nestedatt--values--percentages))

<a id="nestedatt--values--cost_metric" />

### Nested Schema for `values.cost_metric`

Optional:

* `aggregation` (Attributes) (see [below for nested schema](#nestedatt--values--cost_metric--aggregation))
* `filter` (String) The filter VQL for the cost metric.

<a id="nestedatt--values--cost_metric--aggregation" />

### Nested Schema for `values.cost_metric.aggregation`

Optional:

* `tag` (String) The tag to aggregate on.

<a id="nestedatt--values--date_ranges" />

### Nested Schema for `values.date_ranges`

Optional:

* `end_date` (String) Inclusive end date (YYYY-MM-DD), or null for unbounded.
* `start_date` (String) Inclusive start date (YYYY-MM-DD), or null for unbounded.

<a id="nestedatt--values--label_transforms" />

### Nested Schema for `values.label_transforms`

Required:

* `type` (String) The label transform type. One of `split` or `format`.

Optional:

* `delimiter` (String) Delimiter used by split transforms.
* `index` (Number) Zero-based index used by split transforms.
* `template` (String) Template used by format transforms.

<a id="nestedatt--values--percentages" />

### Nested Schema for `values.percentages`

Required:

* `pct` (Number)
* `value` (String) The tag value associated with a percentage of matched costs.
