tags
Creates, updates, deletes, gets or lists a tags resource.
Overview
| Name | tags |
| Type | Resource |
| Id | aws.iot.tags |
Fields
The following fields are returned by SELECT queries:
- list_tags_for_resource
| Name | Datatype | Description |
|---|---|---|
key | string | The tag's key. (pattern: <code>^([\p{L}\p{Z}\p{N}_.:/=+-@]*)$</code>) |
value | string | The tag's value. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_tags_for_resource | select | resourceArn, region | nextToken | Lists the tags (metadata) you have assigned to the resource. Requires permission to access the ListTagsForResource action. |
tag_resource | update | region, resourceArn, tags | 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. | |
untag_resource | update | region, resourceArn, tagKeys | Removes 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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
resourceArn | string | The ARN of the resource. |
nextToken | string | To retrieve the next set of results, the nextToken value from a previous response; otherwise null to receive the first set of results. |
SELECT examples
- list_tags_for_resource
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
- tag_resource
- untag_resource
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;
Removes the given tags (metadata) from the resource. Requires permission to access the UntagResource action.
UPDATE aws.iot.tags
SET
resourceArn = '{{ resourceArn }}',
tagKeys = '{{ tagKeys }}'
WHERE
region = '{{ region }}' --required
AND resourceArn = '{{ resourceArn }}' --required
AND tagKeys = '{{ tagKeys }}' --required;