def role_ids_for_all_accounts(dynamo_table):
    """
    Get a list of all role IDs for all accounts by scanning the Dynamo table

    Args:
        None

    Returns:
        list: role ids in all accounts
    """
    role_ids = []

    response = dynamo_table.scan(ProjectionExpression='RoleId')
    role_ids.extend([role_dict['RoleId'] for role_dict in response['Items']])

    while 'LastEvaluatedKey' in response:
        response = dynamo_table.scan(ProjectionExpression='RoleId',
                                     ExclusiveStartKey=response['LastEvaluatedKey'])
        role_ids.extend([role_dict['RoleId'] for role_dict in response['Items']])
    return role_ids