selectAggregateResourceConfig method

Future<SelectAggregateResourceConfigResponse> selectAggregateResourceConfig({
  1. required String configurationAggregatorName,
  2. required String expression,
  3. int? limit,
  4. int? maxResults,
  5. String? nextToken,
})

Accepts a structured query language (SQL) SELECT command and an aggregator to query configuration state of Amazon Web Services 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 Config Developer Guide.

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.

May throw InvalidExpressionException. May throw InvalidLimitException. May throw InvalidNextTokenException. May throw NoSuchConfigurationAggregatorException.

Parameter configurationAggregatorName : The name of the configuration aggregator.

Parameter expression : The SQL query SELECT command.

Parameter limit : The maximum number of query results returned on each page.

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

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

Implementation

Future<SelectAggregateResourceConfigResponse> selectAggregateResourceConfig({
  required String configurationAggregatorName,
  required String expression,
  int? limit,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'limit',
    limit,
    0,
    100,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    0,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'StarlingDoveService.SelectAggregateResourceConfig'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ConfigurationAggregatorName': configurationAggregatorName,
      'Expression': expression,
      if (limit != null) 'Limit': limit,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return SelectAggregateResourceConfigResponse.fromJson(jsonResponse.body);
}