CmdID

CmdID / aws / aws resource-groups

aws resource-groups update-group-query

Updates the resource query of a group. AWS CLI reference

2 examples 3 options Its page in the AWS CLI reference

Opens CmdID with your command. It is read in your browser and sent nowhere.

Examples

from aws-cli, each command read by CmdID

Example 1: To update the query for a tag-based resource group

The following update-group-query example updates the query attached to the specified tag-based resource group.

aws resource-groups update-group-query --group-name tbq-WebServer --resource-query '{"Type":"TAG_FILTERS_1_0", "Query":"{\"ResourceTypeFilters\":[\"AWS::EC2::Instance\"],\"TagFilters\":[{\"Key\":\"Name\", \"Values\":[\"WebServers\"]}]}"}'Identify
--group-nameDon't use this parameter.
--resource-queryThe resource query to determine which Amazon Web Services resources are members of this resource group.
Its output
{
    "GroupQuery": {
        "GroupName": "tbq-WebServer",
        "ResourceQuery": {
            "Type": "TAG_FILTERS_1_0",
            "Query": "{\"ResourceTypeFilters\":[\"AWS::EC2::Instance\"],\"TagFilters\":[{\"Key\":\"Name\", \"Values\":[\"WebServers\"]}]}"
        }
    }
}

For more information, see Update Groups in the AWS Resource Groups User Guide.

Example 2: To update the query for a CloudFormation stack-based resource group

The following update-group-query example updates the query attached to the specified AWS CloudFormation stack-based resource group.

aws resource-groups update-group-query --group-name cbq-CFNstackgroup --resource-query '{"Type": "CLOUDFORMATION_STACK_1_0", "Query": "{\"ResourceTypeFilters\":[\"AWS::AllSupported\"],\"StackIdentifier\":\"arn:aws:cloudformation:us-west-2:123456789012:stack/MyCFNStack/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111\"}"}'Identify
--group-nameDon't use this parameter.
--resource-queryThe resource query to determine which Amazon Web Services resources are members of this resource group.
Its output
{
    "GroupQuery": {
        "GroupName": "cbq-CFNstackgroup",
        "ResourceQuery": {
            "Type": "CLOUDFORMATION_STACK_1_0",
            "Query": "{\"ResourceTypeFilters\":[\"AWS::AllSupported\"],\"StackIdentifier\":\"arn:aws:cloudformation:us-west-2:123456789012:stack/MyCFNStack/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111\"}"
        }
    }
}

For more information, see Update Groups in the AWS Resource Groups User Guide.

Options

3 in the AWS CLI reference
--group-nameDon't use this parameter.
--groupThe name or the Amazon resource name (ARN) of the resource group to query.
--resource-queryThe resource query to determine which Amazon Web Services resources are members of this resource group.