tags
Creates, updates, deletes, gets or lists a tags resource.
Overview
| Name | tags |
| Type | Resource |
| Id | aws.storagegateway.tags |
Fields
The following fields are returned by SELECT queries:
- list_tags_for_resource
| Name | Datatype | Description |
|---|---|---|
key | string | Tag key. The key can't start with aws:. (pattern: <code>^([\p{L}\p{Z}\p{N}_.:/=+-@]*)$</code>) |
value | string | Value of the tag key. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_tags_for_resource | select | region | Lists the tags that have been added to the specified resource. This operation is supported in storage gateways of all types. | |
add_tags_to_resource | update | region, ResourceARN, Tags | Adds one or more tags to the specified resource. You use tags to add metadata to resources, which you can use to categorize these resources. For example, you can categorize resources by purpose, owner, environment, or team. Each tag consists of a key and a value, which you define. You can add tags to the following Storage Gateway resources: Storage gateways of all types Storage volumes Virtual tapes NFS and SMB file shares File System associations You can create a maximum of 50 tags for each resource. Virtual tapes and storage volumes that are recovered to a new gateway maintain their tags. | |
remove_tags_from_resource | update | region, ResourceARN, TagKeys | Removes one or more tags from the specified resource. This operation is supported in storage gateways of all types. |
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 the tags that have been added to the specified resource. This operation is supported in storage gateways of all types.
SELECT
key,
value
FROM aws.storagegateway.tags
WHERE region = '{{ region }}' -- required
;
UPDATE examples
- add_tags_to_resource
- remove_tags_from_resource
Adds one or more tags to the specified resource. You use tags to add metadata to resources, which you can use to categorize these resources. For example, you can categorize resources by purpose, owner, environment, or team. Each tag consists of a key and a value, which you define. You can add tags to the following Storage Gateway resources: Storage gateways of all types Storage volumes Virtual tapes NFS and SMB file shares File System associations You can create a maximum of 50 tags for each resource. Virtual tapes and storage volumes that are recovered to a new gateway maintain their tags.
UPDATE aws.storagegateway.tags
SET
ResourceARN = '{{ ResourceARN }}',
Tags = '{{ Tags }}'
WHERE
region = '{{ region }}' --required
AND ResourceARN = '{{ ResourceARN }}' --required
AND Tags = '{{ Tags }}' --required
RETURNING
resource_arn;
Removes one or more tags from the specified resource. This operation is supported in storage gateways of all types.
UPDATE aws.storagegateway.tags
SET
ResourceARN = '{{ ResourceARN }}',
TagKeys = '{{ TagKeys }}'
WHERE
region = '{{ region }}' --required
AND ResourceARN = '{{ ResourceARN }}' --required
AND TagKeys = '{{ TagKeys }}' --required
RETURNING
resource_arn;