tags
Creates, updates, deletes, gets or lists a tags resource.
Overview
| Name | tags |
| Type | Resource |
| Id | aws.ds.tags |
Fields
The following fields are returned by SELECT queries:
- list_tags_for_resource
| Name | Datatype | Description |
|---|---|---|
key | string | Required 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>) |
value | string | The 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_tags_for_resource | select | region | Lists all tags on a directory. | |
add_tags_to_resource | update | region, ResourceId, Tags | 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. | |
remove_tags_from_resource | update | region, ResourceId, TagKeys | Removes 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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- list_tags_for_resource
Lists all tags on a directory.
SELECT
key,
value
FROM aws.ds.tags
WHERE region = '{{ region }}' -- required
;
UPDATE examples
- add_tags_to_resource
- remove_tags_from_resource
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;
Removes tags from a directory.
UPDATE aws.ds.tags
SET
ResourceId = '{{ ResourceId }}',
TagKeys = '{{ TagKeys }}'
WHERE
region = '{{ region }}' --required
AND ResourceId = '{{ ResourceId }}' --required
AND TagKeys = '{{ TagKeys }}' --required;