def is_event_from_sns(event):
    """
    Check if the lambda invocation was by SNS.

    :param dict event: Lambda Event (payload)
    :rtype: bool
    """

    try:
        return bool(event['Records'][0]['Sns']['Message'])
    except:
        pass

    try:
        return bool('Message' in event and 'TopicArn' in event and ':sns:' in event['TopicArn'])
    except:
        pass

    return False