import base64
import zlib
import json


def decode_event_data(event):
    """
    Decodes the raw Cloudwatch lambda payload into a dictionary
    representing the JSON structure.
    """
    base64_gzipped_data = str(event['awslogs']['data'])
    gzipped_data = base64.b64decode(base64_gzipped_data)
    json_data = zlib.decompress(gzipped_data, 15+32)

    data = json.loads(json_data)

    return data