Skip to main content

tags

Creates, updates, deletes, gets or lists a tags resource.

Overview

Nametags
TypeResource
Idaws.storagegateway.tags

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
keystringTag key. The key can't start with aws:. (pattern: <code>^([\p{L}\p{Z}\p{N}_.:/=+-@]*)$</code>)
valuestringValue of the tag key.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_tags_for_resourceselectregionLists the tags that have been added to the specified resource. This operation is supported in storage gateways of all types.
add_tags_to_resourceupdateregion, ResourceARN, TagsAdds 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_resourceupdateregion, ResourceARN, TagKeysRemoves 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.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

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

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;