tag_sync_tasks
Creates, updates, deletes, gets or lists a tag_sync_tasks resource.
Overview
| Name | tag_sync_tasks |
| Type | Resource |
| Id | aws.resource_groups.tag_sync_tasks |
Fields
The following fields are returned by SELECT queries:
- get_tag_sync_task
- list_tag_sync_tasks
| Name | Datatype | Description |
|---|---|---|
created_at | string (date-time) | The timestamp of when the tag-sync task was created. |
error_message | string | The specific error message in cases where the tag-sync task status is ERROR. |
group_arn | string | The Amazon resource name (ARN) of the application 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>) |
group_name | string | The name of the application group. (pattern: <code>[a-zA-Z0-9_.-]{1,300}|[a-zA-Z0-9_.-]{1,150}/[a-z0-9]{26}</code>) |
resource_query | object | The query you can use to define a resource group or a search for resources. A ResourceQuery specifies both a query Type and a Query string as JSON string objects. See the examples section for example JSON strings. For more information about creating a resource group with a resource query, see Build queries and groups in Resource Groups in the Resource Groups User Guide When you combine all of the elements together into a single string, any double quotes that are embedded inside another double quote pair must be escaped by preceding the embedded double quote with a backslash character (). For example, a complete ResourceQuery parameter must be formatted like the following CLI parameter example: --resource-query '{"Type":"TAG_FILTERS_1_0","Query":"{"ResourceTypeFilters":["AWS::AllSupported"],"TagFilters":[{"Key":"Stage","Values":["Test"]}]}"}' In the preceding example, all of the double quote characters in the value part of the Query element must be escaped because the value itself is surrounded by double quotes. For more information, see Quoting strings in the Command Line Interface User Guide. For the complete list of resource types that you can use in the array value for ResourceTypeFilters, see Resources you can use with Resource Groups and Tag Editor in the Resource Groups User Guide. For example: "ResourceTypeFilters":["AWS::S3::Bucket", "AWS::EC2::Instance"] |
role_arn | string | The Amazon resource name (ARN) of the role assumed by Resource Groups to tag and untag resources on your behalf. For more information about this role, review Tag-sync required permissions. (pattern: <code>arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@-_/]+</code>) |
status | string | The status of the tag-sync task. Valid values include: ACTIVE - The tag-sync task is actively managing resources in the application by adding or removing the awsApplication tag from resources when they are tagged or untagged with the specified tag key-value pair. ERROR - The tag-sync task is not actively managing resources in the application. Review the ErrorMessage for more information about resolving the error. (ACTIVE, ERROR) |
tag_key | string | The tag key. (pattern: <code>^([\p{L}\p{Z}\p{N}_.:/=+-@]*)$</code>) |
tag_value | string | The tag value. (pattern: <code>^([\p{L}\p{Z}\p{N}_.:/=+-@]*)$</code>) |
task_arn | string | The Amazon resource name (ARN) of the tag-sync task. (pattern: <code>arn:aws(-[a-z]+)*:resource-groups:[a-z]{2}(-[a-z]+)+-\d{1}:[0-9]{12}:group/[a-zA-Z0-9_.-]{1,150}/[a-z0-9]{26}/tag-sync-task/[a-z0-9]{26}</code>) |
| Name | Datatype | Description |
|---|---|---|
created_at | string (date-time) | The timestamp of when the tag-sync task was created. |
error_message | string | The specific error message in cases where the tag-sync task status is Error. |
group_arn | string | The Amazon resource name (ARN) of the application 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>) |
group_name | string | The name of the application group. (pattern: <code>[a-zA-Z0-9_.-]{1,300}|[a-zA-Z0-9_.-]{1,150}/[a-z0-9]{26}</code>) |
resource_query | object | The query you can use to define a resource group or a search for resources. A ResourceQuery specifies both a query Type and a Query string as JSON string objects. See the examples section for example JSON strings. For more information about creating a resource group with a resource query, see Build queries and groups in Resource Groups in the Resource Groups User Guide When you combine all of the elements together into a single string, any double quotes that are embedded inside another double quote pair must be escaped by preceding the embedded double quote with a backslash character (). For example, a complete ResourceQuery parameter must be formatted like the following CLI parameter example: --resource-query '{"Type":"TAG_FILTERS_1_0","Query":"{"ResourceTypeFilters":["AWS::AllSupported"],"TagFilters":[{"Key":"Stage","Values":["Test"]}]}"}' In the preceding example, all of the double quote characters in the value part of the Query element must be escaped because the value itself is surrounded by double quotes. For more information, see Quoting strings in the Command Line Interface User Guide. For the complete list of resource types that you can use in the array value for ResourceTypeFilters, see Resources you can use with Resource Groups and Tag Editor in the Resource Groups User Guide. For example: "ResourceTypeFilters":["AWS::S3::Bucket", "AWS::EC2::Instance"] |
role_arn | string | The Amazon resource name (ARN) of the role assumed by the service to tag and untag resources on your behalf. (pattern: <code>arn:(aws[a-zA-Z-]*)?:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@-_/]+</code>) |
status | string | The status of the tag-sync task. Valid values include: ACTIVE - The tag-sync task is actively managing resources in the application by adding or removing the awsApplication tag from resources when they are tagged or untagged with the specified tag key-value pair. ERROR - The tag-sync task is not actively managing resources in the application. Review the ErrorMessage for more information about resolving the error. (ACTIVE, ERROR) |
tag_key | string | The tag key. (pattern: <code>^([\p{L}\p{Z}\p{N}_.:/=+-@]*)$</code>) |
tag_value | string | The tag value. (pattern: <code>^([\p{L}\p{Z}\p{N}_.:/=+-@]*)$</code>) |
task_arn | string | The Amazon resource name (ARN) of the tag-sync task. (pattern: <code>arn:aws(-[a-z]+)*:resource-groups:[a-z]{2}(-[a-z]+)+-\d{1}:[0-9]{12}:group/[a-zA-Z0-9_.-]{1,150}/[a-z0-9]{26}/tag-sync-task/[a-z0-9]{26}</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_tag_sync_task | select | region | Returns information about a specified tag-sync task. Minimum permissions To run this command, you must have the following permissions: resource-groups:GetTagSyncTask on the application group | |
list_tag_sync_tasks | select | region | Returns a list of tag-sync tasks. Minimum permissions To run this command, you must have the following permissions: resource-groups:ListTagSyncTasks with the group passed in the filters as the resource or * if using no filters |
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
- get_tag_sync_task
- list_tag_sync_tasks
Returns information about a specified tag-sync task. Minimum permissions To run this command, you must have the following permissions: resource-groups:GetTagSyncTask on the application group
SELECT
created_at,
error_message,
group_arn,
group_name,
resource_query,
role_arn,
status,
tag_key,
tag_value,
task_arn
FROM aws.resource_groups.tag_sync_tasks
WHERE region = '{{ region }}' -- required
;
Returns a list of tag-sync tasks. Minimum permissions To run this command, you must have the following permissions: resource-groups:ListTagSyncTasks with the group passed in the filters as the resource or * if using no filters
SELECT
created_at,
error_message,
group_arn,
group_name,
resource_query,
role_arn,
status,
tag_key,
tag_value,
task_arn
FROM aws.resource_groups.tag_sync_tasks
WHERE region = '{{ region }}' -- required
;