Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
thread = PropagatingThread(target=worker_thread, args=(
account_id,
sts,
config,
s3,
cache,
kms_dict
))
thread.start()
threads.append(thread)
for thread in threads:
thread.join()
LOGGER.info("Executing Step Function on Deployment Account")
step_functions = StepFunctions(
role=deployment_account_role,
deployment_account_id=deployment_account_id,
deployment_account_region=config.deployment_account_region,
regions=config.target_regions,
account_ids=account_ids,
update_pipelines_only=0
)
step_functions.execute_statemachine()
except ParameterNotFoundError:
LOGGER.info(
'You are now ready to bootstrap a deployment account '
'by moving it into your deployment OU. '
'Once you have moved it into the deployment OU, '
'be sure to check out its progress in AWS Step Functions'
)
def lambda_handler(event, _):
sts = STS()
role = sts.assume_cross_account_role(
'arn:aws:iam::{0}:role/{1}'.format(
event['deployment_account_id'],
event['cross_account_access_role']),
'step_function')
step_functions = StepFunctions(
role=role,
deployment_account_id=event['deployment_account_id'],
deployment_account_region=event['deployment_account_region'],
full_path=event['full_path'],
regions=event['regions'],
account_ids=[event['account_id']],
update_pipelines_only=1 if event.get('moved_to_protected') or event.get('moved_to_root') else 0,
error=event.get('error', 0)
)
step_functions.execute_statemachine()
return event