Skip to main content

tags

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

Overview

Nametags
TypeResource
Idaws.resource_groups.tags

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
arnstringTheAmazon resource name (ARN) of the tagged resource group. (pattern: <code>arn:aws(-[a-z]+)*:resource-groups:[a-z]{2}(-[a-z]+)+-\d{1}:[0-9]{12}:group/([a-zA-Z0-9_.-]{1,300}|[a-zA-Z0-9_.-]{1,150}/[a-z0-9]{26})</code>)
tagsobjectThe tags associated with the specified resource group.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_tagsselectarn, regionReturns a list of tags that are associated with a resource group, specified by an Amazon resource name (ARN). Minimum permissions To run this command, you must have the following permissions: resource-groups:GetTags
cancel_tag_sync_taskexecregion, TaskArnCancels the specified tag-sync task. Minimum permissions To run this command, you must have the following permissions: resource-groups:CancelTagSyncTask on the application group resource-groups:DeleteGroup
start_tag_sync_taskexecregion, Group, RoleArnCreates a new tag-sync task to onboard and sync resources tagged with a specific tag key-value pair to an application. To start a tag-sync task, you need a resource tagging role. The resource tagging role grants permissions to tag and untag applications resources and must include a trust policy that allows Resource Groups to assume the role and perform resource tagging tasks on your behalf. For instructions on creating a tag-sync task, see Create a tag-sync using the Resource Groups API in the Amazon Web Services Service Catalog AppRegistry Administrator Guide. Minimum permissions To run this command, you must have the following permissions: resource-groups:StartTagSyncTask on the application group resource-groups:CreateGroup iam:PassRole on the role provided in the request

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
arnstringThe Amazon resource name (ARN) of the resource group whose tags you want to retrieve.
regionstringAWS region (default: us-east-1)

SELECT examples

Returns a list of tags that are associated with a resource group, specified by an Amazon resource name (ARN). Minimum permissions To run this command, you must have the following permissions: resource-groups:GetTags

SELECT
arn,
tags
FROM aws.resource_groups.tags
WHERE arn = '{{ arn }}' -- required
AND region = '{{ region }}' -- required
;

Lifecycle Methods

Cancels the specified tag-sync task. Minimum permissions To run this command, you must have the following permissions: resource-groups:CancelTagSyncTask on the application group resource-groups:DeleteGroup

EXEC aws.resource_groups.tags.cancel_tag_sync_task
@region='{{ region }}' --required
@@json=
'{
"TaskArn": "{{ TaskArn }}"
}'
;