def _build_index_definition(index):
    """
    Creates request object to Index to be deployed
    :param index:
    :return:
    """
    index_def = {'IndexName': index['name'], 'KeySchema': [{'AttributeName':
        index['index_key_name'], 'KeyType': 'HASH'}], 'Projection': {
        'ProjectionType': 'ALL'}}
    if index.get('index_sort_key_name'):
        index_def['KeySchema'].append({'AttributeName': index[
            'index_sort_key_name'], 'KeyType': 'RANGE'})
    return index_def
