def get_ous()

in AccountCreationLambda.py [0:0]


def get_ous(parent_id):
    """ List OUs """
    list_of_ou_ids = []

    ou_client = get_client('organizations')
    paginator = ou_client.get_paginator('list_children')
    iterator  = paginator.paginate(
        ParentId=parent_id,
        ChildType='ORGANIZATIONAL_UNIT')

    for page in iterator:
        for ou_list in page['Children']:
            list_of_ou_ids.append(ou_list['Id'])
            list_of_ou_ids.extend(get_ous(ou_list['Id']))

    return list_of_ou_ids