Skip to main content

tags

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

Overview​

Nametags
TypeResource
Idaws.iot.tags

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
keystringThe tag's key. (pattern: <code>^([\p{L}\p{Z}\p{N}_.:/=+-@]*)$</code>)
valuestringThe tag's value.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_tags_for_resourceselectresourceArn, regionnextTokenLists the tags (metadata) you have assigned to the resource. Requires permission to access the ListTagsForResource action.
tag_resourceupdateregion, resourceArn, tagsAdds to or modifies the tags of the given resource. Tags are metadata which can be used to manage a resource. Requires permission to access the TagResource action.
untag_resourceupdateregion, resourceArn, tagKeysRemoves the given tags (metadata) from the resource. Requires permission to access the UntagResource action.

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)
resourceArnstringThe ARN of the resource.
nextTokenstringTo retrieve the next set of results, the nextToken value from a previous response; otherwise null to receive the first set of results.

SELECT examples​

Lists the tags (metadata) you have assigned to the resource. Requires permission to access the ListTagsForResource action.

SELECT
key,
value
FROM aws.iot.tags
WHERE resourceArn = '{{ resourceArn }}' -- required
AND region = '{{ region }}' -- required
AND nextToken = '{{ nextToken }}'
;

UPDATE examples​

Adds to or modifies the tags of the given resource. Tags are metadata which can be used to manage a resource. Requires permission to access the TagResource action.

UPDATE aws.iot.tags
SET
resourceArn = '{{ resourceArn }}',
tags = '{{ tags }}'
WHERE
region = '{{ region }}' --required
AND resourceArn = '{{ resourceArn }}' --required
AND tags = '{{ tags }}' --required;