importStacksToStackSet method

Future<ImportStacksToStackSetOutput> importStacksToStackSet({
  1. required String stackSetName,
  2. CallAs? callAs,
  3. String? operationId,
  4. StackSetOperationPreferences? operationPreferences,
  5. List<String>? organizationalUnitIds,
  6. List<String>? stackIds,
  7. String? stackIdsUrl,
})

Import existing stacks into a new StackSets. Use the stack import operation to import up to 10 stacks into a new StackSet in the same account as the source stack or in a different administrator account and Region, by specifying the stack ID of the stack you intend to import.

May throw InvalidOperationException. May throw LimitExceededException. May throw OperationIdAlreadyExistsException. May throw OperationInProgressException. May throw StackNotFoundException. May throw StackSetNotFoundException. May throw StaleRequestException.

Parameter stackSetName : The name of the StackSet. The name must be unique in the Region where you create your StackSet.

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

  • If you are signed in to the management account, specify SELF.
  • For service managed StackSets, specify DELEGATED_ADMIN.

Parameter operationId : A unique, user defined, identifier for the StackSet operation.

Parameter operationPreferences : The user-specified preferences for how CloudFormation performs a StackSet operation.

For more information about maximum concurrent accounts and failure tolerance, see StackSet operation options.

Parameter organizationalUnitIds : The list of OU ID's to which the imported stacks must be mapped as deployment targets.

Parameter stackIds : The IDs of the stacks you are importing into a StackSet. You import up to 10 stacks per StackSet at a time.

Specify either StackIds or StackIdsUrl.

Parameter stackIdsUrl : The Amazon S3 URL which contains list of stack ids to be inputted.

Specify either StackIds or StackIdsUrl.

Implementation

Future<ImportStacksToStackSetOutput> importStacksToStackSet({
  required String stackSetName,
  CallAs? callAs,
  String? operationId,
  StackSetOperationPreferences? operationPreferences,
  List<String>? organizationalUnitIds,
  List<String>? stackIds,
  String? stackIdsUrl,
}) async {
  final $request = <String, String>{
    'StackSetName': stackSetName,
    if (callAs != null) 'CallAs': callAs.value,
    'OperationId': operationId ?? _s.generateIdempotencyToken(),
    if (operationPreferences != null)
      for (var e1 in operationPreferences.toQueryMap().entries)
        'OperationPreferences.${e1.key}': e1.value,
    if (organizationalUnitIds != null)
      if (organizationalUnitIds.isEmpty)
        'OrganizationalUnitIds': ''
      else
        for (var i1 = 0; i1 < organizationalUnitIds.length; i1++)
          'OrganizationalUnitIds.member.${i1 + 1}': organizationalUnitIds[i1],
    if (stackIds != null)
      if (stackIds.isEmpty)
        'StackIds': ''
      else
        for (var i1 = 0; i1 < stackIds.length; i1++)
          'StackIds.member.${i1 + 1}': stackIds[i1],
    if (stackIdsUrl != null) 'StackIdsUrl': stackIdsUrl,
  };
  final $result = await _protocol.send(
    $request,
    action: 'ImportStacksToStackSet',
    version: '2010-05-15',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    resultWrapper: 'ImportStacksToStackSetResult',
  );
  return ImportStacksToStackSetOutput.fromXml($result);
}