Skip to main content

tags

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

Overview

Nametags
TypeResource
Idaws.ds.tags

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
keystringRequired name of the tag. The string value can be Unicode characters and cannot be prefixed with "aws:". The string can contain only the set of Unicode letters, digits, white-space, '', '.', '/', '=', '+', '-', ':', '@'(Java regex: "^([\p{L}\p{Z}\p{N}.:/=+\-])$"). (pattern: <code>^([\p{L}\p{Z}\p{N}_.:/=+-@])$</code>)
valuestringThe optional value of the tag. The string value can be Unicode characters. The string can contain only the set of Unicode letters, digits, white-space, '', '.', '/', '=', '+', '-', ':', '@' (Java regex: "^([\p{L}\p{Z}\p{N}.:/=+\-])$"). (pattern: <code>^([\p{L}\p{Z}\p{N}_.:/=+-@])$</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_tags_for_resourceselectregionLists all tags on a directory.
add_tags_to_resourceupdateregion, ResourceId, TagsAdds or overwrites one or more tags for the specified directory. Each directory can have a maximum of 50 tags. Each tag consists of a key and optional value. Tag keys must be unique to each resource.
remove_tags_from_resourceupdateregion, ResourceId, TagKeysRemoves tags from a directory.

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
regionstringAWS region (default: us-east-1)

SELECT examples

Lists all tags on a directory.

SELECT
key,
value
FROM aws.ds.tags
WHERE region = '{{ region }}' -- required
;

UPDATE examples

Adds or overwrites one or more tags for the specified directory. Each directory can have a maximum of 50 tags. Each tag consists of a key and optional value. Tag keys must be unique to each resource.

UPDATE aws.ds.tags
SET
ResourceId = '{{ ResourceId }}',
Tags = '{{ Tags }}'
WHERE
region = '{{ region }}' --required
AND ResourceId = '{{ ResourceId }}' --required
AND Tags = '{{ Tags }}' --required;