UpdateGroupQueryCommand

Updates the resource query of a group. For more information about resource queries, see Create a tag-based group in Resource Groups .

Minimum permissions

To run this command, you must have the following permissions:

  • resource-groups:UpdateGroupQuery

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { ResourceGroupsClient, UpdateGroupQueryCommand } from "@aws-sdk/client-resource-groups"; // ES Modules import
// const { ResourceGroupsClient, UpdateGroupQueryCommand } = require("@aws-sdk/client-resource-groups"); // CommonJS import
const client = new ResourceGroupsClient(config);
const input = { // UpdateGroupQueryInput
  GroupName: "STRING_VALUE",
  Group: "STRING_VALUE",
  ResourceQuery: { // ResourceQuery
    Type: "TAG_FILTERS_1_0" || "CLOUDFORMATION_STACK_1_0", // required
    Query: "STRING_VALUE", // required
  },
};
const command = new UpdateGroupQueryCommand(input);
const response = await client.send(command);
// { // UpdateGroupQueryOutput
//   GroupQuery: { // GroupQuery
//     GroupName: "STRING_VALUE", // required
//     ResourceQuery: { // ResourceQuery
//       Type: "TAG_FILTERS_1_0" || "CLOUDFORMATION_STACK_1_0", // required
//       Query: "STRING_VALUE", // required
//     },
//   },
// };

UpdateGroupQueryCommand Input

See UpdateGroupQueryCommandInput for more details

Parameter
Type
Description
ResourceQuery
Required
ResourceQuery | undefined

The resource query to determine which Amazon Web Services resources are members of this resource group.

A resource group can contain either a Configuration or a ResourceQuery, but not both.

Group
string | undefined

The name or the Amazon resource name (ARN) of the resource group to query.

GroupName
string | undefined

Don't use this parameter. Use Group instead.

UpdateGroupQueryCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
GroupQuery
GroupQuery | undefined

The updated resource query associated with the resource group after the update.

Throws

Name
Fault
Details
BadRequestException
client

The request includes one or more parameters that violate validation rules.

ForbiddenException
client

The caller isn't authorized to make the request. Check permissions.

InternalServerErrorException
server

An internal error occurred while processing the request. Try again later.

MethodNotAllowedException
client

The request uses an HTTP method that isn't allowed for the specified resource.

NotFoundException
client

One or more of the specified resources don't exist.

TooManyRequestsException
client

You've exceeded throttling limits by making too many requests in a period of time.

ResourceGroupsServiceException
Base exception class for all service exceptions from ResourceGroups service.