Skip to main content

tags

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

Overview

Nametags
TypeResource
Idaws.greengrassv2.tags

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
tagsobjectA list of key-value pairs that contain metadata for the resource. For more information, see Tag your resources in the IoT Greengrass V2 Developer Guide.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_tags_for_resourceselectresource_arn, regionRetrieves the list of tags for an IoT Greengrass resource.
tag_resourceupdateresource_arn, region, tagsAdds tags to an IoT Greengrass resource. If a tag already exists for the resource, this operation updates the tag's value.
untag_resourceupdateresource_arn, tagKeys, regionRemoves a tag from an IoT Greengrass resource.

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)
resource_arnstringThe ARN of the resource to untag.
tagKeysarrayA list of keys for tags to remove from the resource.

SELECT examples

Retrieves the list of tags for an IoT Greengrass resource.

SELECT
tags
FROM aws.greengrassv2.tags
WHERE resource_arn = '{{ resource_arn }}' -- required
AND region = '{{ region }}' -- required
;

UPDATE examples

Adds tags to an IoT Greengrass resource. If a tag already exists for the resource, this operation updates the tag's value.

UPDATE aws.greengrassv2.tags
SET
tags = '{{ tags }}'
WHERE
resource_arn = '{{ resource_arn }}' --required
AND region = '{{ region }}' --required
AND tags = '{{ tags }}' --required;