def remove_all()

in functions/source/c1c_controltower_lifecycle.py [0:0]


def remove_all(function_name):
    client = boto3.client("lambda")
    logger.info(f"Received function name {function_name} from context")
    count = 0
    for account_id in get_accounts():
        logger.info(f"Launched remove_account_config for {account_id}")
        client.invoke(
            FunctionName=function_name,
            InvocationType="Event",
            Payload=json.dumps(
                {"InvokeAction": "remove_account_config", "account_id": account_id}
            ),
        )
        count += 1
    logger.info(f"Launched remove_account_config for {count} accounts")
    return None