tags
Creates, updates, deletes, gets or lists a tags resource.
Overview
| Name | tags |
| Type | Resource |
| Id | datadog.cloud_costs.tags |
Fields
The following fields are returned by SELECT queries:
- list_cost_tags
| Name | Datatype | Description |
|---|---|---|
id | string | The tag identifier, equal to its key:value representation. (example: providername:aws) |
attributes | object | Attributes of a Cloud Cost Management tag. |
type | string | Type of the Cloud Cost Management tag resource. (cost_tag) (default: cost_tag, example: cost_tag) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_cost_tags | select | filter[metric], filter[match], filter[tags], filter[tag_keys], page[size] | List Cloud Cost Management tags for a given metric. |
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. |
filter[match] | string | A substring used to filter the returned tags by name. |
filter[metric] | string | The Cloud Cost Management metric to scope the tags to. When omitted, returns tags across all metrics. |
filter[tag_keys] | array | Restrict the returned tags to those whose key matches one of the given tag keys. |
filter[tags] | array | Filter to return only tags that appear with the given key:value tag values. For example, filter[tags]=providername:aws returns tags found on the same cost data, such as aws_instance_type:t3.micro and aws_instance_type:m5.large. |
page[size] | integer (int32) | Controls the size of the internal tag search scope. This does not restrict the number of tags returned in the response. Defaults to 50, maximum 10000. |
SELECT examples
- list_cost_tags
List Cloud Cost Management tags for a given metric.
SELECT
id,
attributes,
type
FROM datadog.cloud_costs.tags
WHERE filter[metric] = '{{ filter[metric] }}'
AND filter[match] = '{{ filter[match] }}'
AND filter[tags] = '{{ filter[tags] }}'
AND filter[tag_keys] = '{{ filter[tag_keys] }}'
AND page[size] = '{{ page[size] }}'
;