Skip to main content

tag_keys

Creates, updates, deletes, gets or lists a tag_keys resource.

Overview

Nametag_keys
TypeResource
Iddatadog.cloud_costs.tag_keys

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe tag key identifier. (example: providername)
attributesobjectAttributes of a Cloud Cost Management tag key.
typestringType 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:

NameAccessible byRequired ParamsOptional ParamsDescription
get_cost_tag_keyselecttag_keyfilter[metric], page[size]Get details for a specific Cloud Cost Management tag key, including example tag values and description.
list_cost_tag_keysselectfilter[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.

NameDatatypeDescription
sitestringThe 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_keystringThe Cloud Cost Management tag key. Tag keys can contain forward slashes (for example, kubernetes/instance).
filter[metric]stringThe Cloud Cost Management metric to scope the tag keys to. When omitted, returns tag keys across all metrics.
filter[tags]arrayFilter 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 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] }}'
;