getAggregateDiscoveredResourceCounts method
Returns the resource counts across accounts and regions that are present in your Config aggregator. You can request the resource counts by providing filters and GroupByKey.
For example, if the input contains accountID 12345678910 and region us-east-1 in filters, the API returns the count of resources in account ID 12345678910 and region us-east-1. If the input contains ACCOUNT_ID as a GroupByKey, the API returns resource counts for all source accounts that are present in your aggregator.
May throw InvalidLimitException.
May throw InvalidNextTokenException.
May throw NoSuchConfigurationAggregatorException.
May throw ValidationException.
Parameter configurationAggregatorName :
The name of the configuration aggregator.
Parameter filters :
Filters the results based on the ResourceCountFilters object.
Parameter groupByKey :
The key to group the resource counts.
Parameter limit :
The maximum number of GroupedResourceCount objects returned on each
page. The default is 1000. You cannot specify a number greater than 1000.
If you specify 0, Config uses the default.
Parameter nextToken :
The nextToken string returned on a previous page that you use
to get the next page of results in a paginated response.
Implementation
Future<GetAggregateDiscoveredResourceCountsResponse>
getAggregateDiscoveredResourceCounts({
required String configurationAggregatorName,
ResourceCountFilters? filters,
ResourceCountGroupKey? groupByKey,
int? limit,
String? nextToken,
}) async {
_s.validateNumRange(
'limit',
limit,
0,
1000,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'StarlingDoveService.GetAggregateDiscoveredResourceCounts'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'ConfigurationAggregatorName': configurationAggregatorName,
if (filters != null) 'Filters': filters,
if (groupByKey != null) 'GroupByKey': groupByKey.value,
if (limit != null) 'Limit': limit,
if (nextToken != null) 'NextToken': nextToken,
},
);
return GetAggregateDiscoveredResourceCountsResponse.fromJson(
jsonResponse.body);
}