SelectAggregateResourceConfig - AWS Config

SelectAggregateResourceConfig

Accepts a structured query language (SQL) SELECT command and an aggregator to query configuration state of AWS resources across multiple accounts and regions, performs the corresponding search, and returns resource configurations matching the properties.

For more information about query components, see the Query Components section in the AWS Config Developer Guide.

Note

If you run an aggregation query (i.e., using GROUP BY or using aggregate functions such as COUNT; e.g., SELECT resourceId, COUNT(*) WHERE resourceType = 'AWS::IAM::Role' GROUP BY resourceId) and do not specify the MaxResults or the Limit query parameters, the default page size is set to 500.

If you run a non-aggregation query (i.e., not using GROUP BY or aggregate function; e.g., SELECT * WHERE resourceType = 'AWS::IAM::Role') and do not specify the MaxResults or the Limit query parameters, the default page size is set to 25.

Request Syntax

{ "ConfigurationAggregatorName": "string", "Expression": "string", "Limit": number, "MaxResults": number, "NextToken": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

ConfigurationAggregatorName

The name of the configuration aggregator.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 256.

Pattern: [\w\-]+

Required: Yes

Expression

The SQL query SELECT command.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 4096.

Required: Yes

Limit

The maximum number of query results returned on each page.

Type: Integer

Valid Range: Minimum value of 0. Maximum value of 100.

Required: No

MaxResults

The maximum number of query results returned on each page. AWS Config also allows the Limit request parameter.

Type: Integer

Valid Range: Minimum value of 0. Maximum value of 100.

Required: No

NextToken

The nextToken string returned in a previous request that you use to request the next page of results in a paginated response.

Type: String

Required: No

Response Syntax

{ "NextToken": "string", "QueryInfo": { "SelectFields": [ { "Name": "string" } ] }, "Results": [ "string" ] }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

NextToken

The nextToken string returned in a previous request that you use to request the next page of results in a paginated response.

Type: String

QueryInfo

Details about the query.

Type: QueryInfo object

Results

Returns the results for the SQL query.

Type: Array of strings

Errors

For information about the errors that are common to all actions, see Common Errors.

InvalidExpressionException

The syntax of the query is incorrect.

HTTP Status Code: 400

InvalidLimitException

The specified limit is outside the allowable range.

HTTP Status Code: 400

InvalidNextTokenException

The specified next token is not valid. Specify the nextToken string that was returned in the previous response to get the next page of results.

HTTP Status Code: 400

NoSuchConfigurationAggregatorException

You have specified a configuration aggregator that does not exist.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: