tags
Creates, updates, deletes, gets or lists a tags resource.
Overview
| Name | tags |
| Type | Resource |
| Id | aws.cloudtrail.tags |
Fields
The following fields are returned by SELECT queries:
- list_tags
| Name | Datatype | Description |
|---|---|---|
resource_id | string | Specifies the ARN of the resource. |
tags_list | array | A list of tags. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_tags | select | region | Lists the tags for the specified trails, event data stores, dashboards, or channels in the current Region. | |
add_tags | update | region, ResourceId, TagsList | Adds one or more tags to a trail, event data store, dashboard, or channel, up to a limit of 50. Overwrites an existing tag's value when a new value is specified for an existing tag key. Tag key names must be unique; you cannot have two keys with the same name but different values. If you specify a key without a value, the tag will be created with the specified key and a value of null. You can tag a trail or event data store that applies to all Amazon Web Services Regions only from the Region in which the trail or event data store was created (also known as its home Region). | |
remove_tags | exec | region, ResourceId, TagsList | Removes the specified tags from a trail, event data store, dashboard, or channel. |
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
Lists the tags for the specified trails, event data stores, dashboards, or channels in the current Region.
SELECT
resource_id,
tags_list
FROM aws.cloudtrail.tags
WHERE region = '{{ region }}' -- required
;
UPDATE examples
- add_tags
Adds one or more tags to a trail, event data store, dashboard, or channel, up to a limit of 50. Overwrites an existing tag's value when a new value is specified for an existing tag key. Tag key names must be unique; you cannot have two keys with the same name but different values. If you specify a key without a value, the tag will be created with the specified key and a value of null. You can tag a trail or event data store that applies to all Amazon Web Services Regions only from the Region in which the trail or event data store was created (also known as its home Region).
UPDATE aws.cloudtrail.tags
SET
ResourceId = '{{ ResourceId }}',
TagsList = '{{ TagsList }}'
WHERE
region = '{{ region }}' --required
AND ResourceId = '{{ ResourceId }}' --required
AND TagsList = '{{ TagsList }}' --required;
Lifecycle Methods
- remove_tags
Removes the specified tags from a trail, event data store, dashboard, or channel.
EXEC aws.cloudtrail.tags.remove_tags
@region='{{ region }}' --required
@@json=
'{
"ResourceId": "{{ ResourceId }}",
"TagsList": "{{ TagsList }}"
}'
;