listStackInstances method

Future<ListStackInstancesOutput> listStackInstances({
  1. required String stackSetName,
  2. CallAs? callAs,
  3. List<StackInstanceFilter>? filters,
  4. int? maxResults,
  5. String? nextToken,
  6. String? stackInstanceAccount,
  7. String? stackInstanceRegion,
})

Returns summary information about stack instances that are associated with the specified StackSet. You can filter for stack instances that are associated with a specific Amazon Web Services account name or Region, or that have a specific status.

May throw StackSetNotFoundException.

Parameter stackSetName : The name or unique ID of the StackSet that you want to list stack instances for.

Parameter callAs : [Service-managed permissions] Specifies whether you are acting as an account administrator in the organization's management account or as a delegated administrator in a member account.

By default, SELF is specified. Use SELF for StackSets with self-managed permissions.

  • If you are signed in to the management account, specify SELF.
  • If you are signed in to a delegated administrator account, specify DELEGATED_ADMIN.

    Your Amazon Web Services account must be registered as a delegated administrator in the management account. For more information, see Register a delegated administrator in the CloudFormation User Guide.

Parameter filters : The filter to apply to stack instances

Parameter maxResults : The maximum number of results to be returned with a single call. If the number of available results exceeds this maximum, the response includes a NextToken value that you can assign to the NextToken request parameter to get the next set of results.

Parameter nextToken : The token for the next set of items to return. (You received this token from a previous call.)

Parameter stackInstanceAccount : The name of the Amazon Web Services account that you want to list stack instances for.

Parameter stackInstanceRegion : The name of the Region where you want to list stack instances.

Implementation

Future<ListStackInstancesOutput> listStackInstances({
  required String stackSetName,
  CallAs? callAs,
  List<StackInstanceFilter>? filters,
  int? maxResults,
  String? nextToken,
  String? stackInstanceAccount,
  String? stackInstanceRegion,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final $request = <String, String>{
    'StackSetName': stackSetName,
    if (callAs != null) 'CallAs': callAs.value,
    if (filters != null)
      if (filters.isEmpty)
        'Filters': ''
      else
        for (var i1 = 0; i1 < filters.length; i1++)
          for (var e3 in filters[i1].toQueryMap().entries)
            'Filters.member.${i1 + 1}.${e3.key}': e3.value,
    if (maxResults != null) 'MaxResults': maxResults.toString(),
    if (nextToken != null) 'NextToken': nextToken,
    if (stackInstanceAccount != null)
      'StackInstanceAccount': stackInstanceAccount,
    if (stackInstanceRegion != null)
      'StackInstanceRegion': stackInstanceRegion,
  };
  final $result = await _protocol.send(
    $request,
    action: 'ListStackInstances',
    version: '2010-05-15',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    resultWrapper: 'ListStackInstancesResult',
  );
  return ListStackInstancesOutput.fromXml($result);
}