tags
Creates, updates, deletes, gets or lists a tags resource.
Overview
| Name | tags |
| Type | Resource |
| Id | aws.opensearch.tags |
Fields
The following fields are returned by SELECT queries:
- list_tags
| Name | Datatype | Description |
|---|---|---|
tag_list | array | A list of tags attached to a domain. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_tags | select | arn, region | Returns all resource tags for an Amazon OpenSearch Service domain, data source, or application. For more information, see Tagging Amazon OpenSearch Service resources. | |
add_tags | update | region, TagList | Attaches tags to an existing Amazon OpenSearch Service domain, data source, or application. Tags are a set of case-sensitive key-value pairs. A domain, data source, or application can have up to 10 tags. For more information, see Tagging Amazon OpenSearch Service resources. | |
remove_tags | update | region, TagKeys | Removes the specified set of tags from an Amazon OpenSearch Service domain, data source, or application. For more information, see Tagging Amazon OpenSearch Service resources. |
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 |
|---|---|---|
arn | string | Amazon Resource Name (ARN) for the domain, data source, or application to view tags for. |
region | string | AWS region (default: us-east-1) |
SELECT examples
- list_tags
Returns all resource tags for an Amazon OpenSearch Service domain, data source, or application. For more information, see Tagging Amazon OpenSearch Service resources.
SELECT
tag_list
FROM aws.opensearch.tags
WHERE arn = '{{ arn }}' -- required
AND region = '{{ region }}' -- required
;
UPDATE examples
- add_tags
- remove_tags
Attaches tags to an existing Amazon OpenSearch Service domain, data source, or application. Tags are a set of case-sensitive key-value pairs. A domain, data source, or application can have up to 10 tags. For more information, see Tagging Amazon OpenSearch Service resources.
UPDATE aws.opensearch.tags
SET
ARN = '{{ ARN }}',
TagList = '{{ TagList }}'
WHERE
region = '{{ region }}' --required
AND TagList = '{{ TagList }}' --required;
Removes the specified set of tags from an Amazon OpenSearch Service domain, data source, or application. For more information, see Tagging Amazon OpenSearch Service resources.
UPDATE aws.opensearch.tags
SET
ARN = '{{ ARN }}',
TagKeys = '{{ TagKeys }}'
WHERE
region = '{{ region }}' --required
AND TagKeys = '{{ TagKeys }}' --required;