tag_keys
Creates, updates, deletes, gets or lists a tag_keys resource.
Overview
| Name | tag_keys |
| Type | Resource |
| Id | datadog.cloud_costs.tag_keys |
Fields
The following fields are returned by SELECT queries:
- get_cost_tag_key
- list_cost_tag_keys
| Name | Datatype | Description |
|---|---|---|
id | string | The tag key identifier. (example: providername) |
attributes | object | Attributes of a Cloud Cost Management tag key. |
type | string | Type of the Cloud Cost Management tag key resource. (cost_tag_key) (default: cost_tag_key, example: cost_tag_key) |
| Name | Datatype | Description |
|---|---|---|
id | string | The tag key identifier. (example: providername) |
attributes | object | Attributes of a Cloud Cost Management tag key. |
type | string | Type of the Cloud Cost Management tag key resource. (cost_tag_key) (default: cost_tag_key, example: cost_tag_key) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_cost_tag_key | select | tag_key | filter[metric], page[size] | Get details for a specific Cloud Cost Management tag key, including example tag values and description. |
list_cost_tag_keys | select | filter[metric], filter[tags] | List Cloud Cost Management tag keys. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
site | string | The Datadog site (region) for your organization, for example datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, ap1.datadoghq.com, ap2.datadoghq.com, datadoghq.eu, ddog-gov.com. Resolved from the DD_SITE environment variable when set. Optional: defaults to datadoghq.com, or the value of the DD_SITE environment variable when set; a WHERE value overrides both. |
tag_key | string | The Cloud Cost Management tag key. Tag keys can contain forward slashes (for example, kubernetes/instance). |
filter[metric] | string | The Cloud Cost Management metric to scope the tag keys to. When omitted, returns tag keys across all metrics. |
filter[tags] | array | Filter to return only tag keys that appear with the given key:value tag values. For example, filter[tags]=providername:aws returns tag keys found on the same cost data, such as is_aws_ec2_compute and aws_instance_type. |
page[size] | integer (int32) | Controls the size of the internal tag value search scope. This does not restrict the number of example tag values returned in the response. Defaults to 50, maximum 10000. |
SELECT examples
- get_cost_tag_key
- list_cost_tag_keys
Get details for a specific Cloud Cost Management tag key, including example tag values and description.
SELECT
id,
attributes,
type
FROM datadog.cloud_costs.tag_keys
WHERE tag_key = '{{ tag_key }}' -- required
AND filter[metric] = '{{ filter[metric] }}'
AND page[size] = '{{ page[size] }}'
;
List Cloud Cost Management tag keys.
SELECT
id,
attributes,
type
FROM datadog.cloud_costs.tag_keys
WHERE filter[metric] = '{{ filter[metric] }}'
AND filter[tags] = '{{ filter[tags] }}'
;