def create_stack_instances_with_override_params()

in source/aws/services/cloudformation.py [0:0]


    def create_stack_instances_with_override_params(self, stack_set_name,
                                                    account_list, region_list,
                                                    override_params):
        try:
            parameters = []
            param_dict = {}
            for key, value in override_params.items():
                """This condition checks if the value is a List and convert
                it  into a Comma-delimited string. Note: Remember to change
                the parameter type from 'List<AWS::EC2::*::*>' (Supported
                AWS-Specific Parameter Types) to 'CommaDelimitedList' in the
                 template."""

                if type(value) == list:
                    value = ",".join(map(str, value))
                param_dict['ParameterKey'] = key
                param_dict['ParameterValue'] = value
                parameters.append(param_dict.copy())

            response = self.cfn_client.create_stack_instances(
                StackSetName=stack_set_name,
                Accounts=account_list,
                Regions=region_list,
                ParameterOverrides=parameters,
                OperationPreferences={
                    'FailureTolerancePercentage': self.failed_tolerance_percent,
                    'MaxConcurrentPercentage': self.max_concurrent_percent,
                    'RegionConcurrencyType': self.region_concurrency_type
                }
            )
            return response
        except ClientError as e:
            if e.response['Error']['Code'] == 'OperationInProgressException':
                self.logger.info("Caught exception "
                                 "'OperationInProgressException', "
                                 "handling the exception...")
                return {"OperationId": "OperationInProgressException"}
            else:
                self.logger.log_unhandled_exception(e)
                raise