in code/ct_flowlog_lifecycle.py [0:0]
def create_stack_instance(target_session, stackset_name, account, regions):
'''
Create stackset in particular account + region
'''
try:
cfn_client = target_session.client('cloudformation')
response = cfn_client.create_stack_instances(
StackSetName=stackset_name,
Accounts=account,
Regions=regions
)
LOGGER.debug(response)
LOGGER.info("Launched stackset instance {} for account {} in regions: {} with Operation id: {}".format(
stackset_name, account, regions, response["OperationId"]))
return True
except Exception as e:
LOGGER.error("Could not create stackset instance : {}".format(e))
return False