tags
Creates, updates, deletes, gets or lists a tags resource.
Overview
| Name | tags |
| Type | Resource |
| Id | aws.ce.tags |
Fields
The following fields are returned by SELECT queries:
- get_tags
- list_tags_for_resource
| Name | Datatype | Description |
|---|---|---|
next_page_token | string | The token for the next set of retrievable results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size. (pattern: <code>[\S\s]*</code>) |
return_size | integer | The number of query results that Amazon Web Services returns at a time. |
tags | array | The tags that match your request. |
total_size | integer | The total number of query results. |
| Name | Datatype | Description |
|---|---|---|
resource_tags | array | A list of tag key value pairs that are associated with the resource. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_tags | select | region | Queries for available tag keys and tag values for a specified period. You can search the tag values for an arbitrary string. | |
list_tags_for_resource | select | region | Returns a list of resource tags associated with the resource specified by the Amazon Resource Name (ARN). | |
tag_resource | update | region, ResourceArn, ResourceTags | An API operation for adding one or more tags (key-value pairs) to a resource. You can use the TagResource operation with a resource that already has tags. If you specify a new tag key for the resource, this tag is appended to the list of tags associated with the resource. If you specify a tag key that is already associated with the resource, the new tag value you specify replaces the previous value for that tag. Although the maximum number of array members is 200, user-tag maximum is 50. The remaining are reserved for Amazon Web Services use. | |
untag_resource | update | region, ResourceArn, ResourceTagKeys | Removes one or more tags from a resource. Specify only tag keys in your request. Don't specify the value. |
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
- get_tags
- list_tags_for_resource
Queries for available tag keys and tag values for a specified period. You can search the tag values for an arbitrary string.
SELECT
next_page_token,
return_size,
tags,
total_size
FROM aws.ce.tags
WHERE region = '{{ region }}' -- required
;
Returns a list of resource tags associated with the resource specified by the Amazon Resource Name (ARN).
SELECT
resource_tags
FROM aws.ce.tags
WHERE region = '{{ region }}' -- required
;
UPDATE examples
- tag_resource
- untag_resource
An API operation for adding one or more tags (key-value pairs) to a resource. You can use the TagResource operation with a resource that already has tags. If you specify a new tag key for the resource, this tag is appended to the list of tags associated with the resource. If you specify a tag key that is already associated with the resource, the new tag value you specify replaces the previous value for that tag. Although the maximum number of array members is 200, user-tag maximum is 50. The remaining are reserved for Amazon Web Services use.
UPDATE aws.ce.tags
SET
ResourceArn = '{{ ResourceArn }}',
ResourceTags = '{{ ResourceTags }}'
WHERE
region = '{{ region }}' --required
AND ResourceArn = '{{ ResourceArn }}' --required
AND ResourceTags = '{{ ResourceTags }}' --required;
Removes one or more tags from a resource. Specify only tag keys in your request. Don't specify the value.
UPDATE aws.ce.tags
SET
ResourceArn = '{{ ResourceArn }}',
ResourceTagKeys = '{{ ResourceTagKeys }}'
WHERE
region = '{{ region }}' --required
AND ResourceArn = '{{ ResourceArn }}' --required
AND ResourceTagKeys = '{{ ResourceTagKeys }}' --required;