tags
Creates, updates, deletes, gets or lists a tags resource.
Overview
| Name | tags |
| Type | Resource |
| Id | aws.resource_groups.tags |
Fields
The following fields are returned by SELECT queries:
- get_tags
| Name | Datatype | Description |
|---|---|---|
arn | string | TheAmazon 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>) |
tags | object | The tags associated with the specified resource group. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_tags | select | arn, region | 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 | |
cancel_tag_sync_task | exec | region, TaskArn | 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 | |
start_tag_sync_task | exec | region, Group, RoleArn | Creates 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.
| Name | Datatype | Description |
|---|---|---|
arn | string | The Amazon resource name (ARN) of the resource group whose tags you want to retrieve. |
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_tags
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
- cancel_tag_sync_task
- start_tag_sync_task
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 }}"
}'
;
Creates 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
EXEC aws.resource_groups.tags.start_tag_sync_task
@region='{{ region }}' --required
@@json=
'{
"Group": "{{ Group }}",
"TagKey": "{{ TagKey }}",
"TagValue": "{{ TagValue }}",
"ResourceQuery": "{{ ResourceQuery }}",
"RoleArn": "{{ RoleArn }}"
}'
;