in source/Main_Orchestrator.py [0:0]
def lambda_handler(evrent, context):
# Loop through the list of accounts configured in the configuration file and
# for each account get each account configs
for app_account in app_account_list:
for account_id in app_account:
CustTempAcctConfig = app_account[str(account_id)]
app_acct_role = CustTempAcctConfig['app_acct_role']
# Validate input for account ID and account role
IsValidAppAcctRoleInput = validate_config_input(app_acct_role,"^[A-Za-z0-9-:_/]{1,1000}$",1,1000)
# Only proceed if the values are valid
if IsValidAppAcctRoleInput== True:
try:
# For each account get the AMS managed RFCs and SRs call into step functions
# to call into Lambda functions to execute the API calls
if CustToolsAcctId == account_id:
sys.exit("Cannot run inflation scripts on local account")
ams_ct_list = CustTempAcctConfig['ams_managed_list']
# Check if AWS managed services has a configuration
if len(ams_ct_list) > 0:
process_ct_list(ams_ct_list,account_id,app_acct_role)
else:
print('AMS change list is empty')
except Exception as process_ct_list_failure:
print(str(process_ct_list_failure))
try:
if CustToolsAcctId == account_id:
sys.exit("Cannot run inflation scripts on local account")
customer_change_list = CustTempAcctConfig['customer_managed_list']
# Check if customer managed account list has any configurations
if len(customer_change_list) > 0:
process_ct_list(customer_change_list, account_id,app_acct_role)
else:
print ('Customer change list is empty' )
except Exception as process_ct_list_failure:
print(str(process_ct_list_failure))
else:
sys.exit("Role value" + " " + str(app_acct_role) + "is not valid a input" + str(IsValidAppAcctRoleInput ))