def diff_log_groups(log_group_options, old_log_group_options):
    """Upon a CloudFormation stack Create or Update event, logGroupOptions is passed in the
    event parameter to Lambda.  Upon a CloudFormation Update event the old logGroupOptions is also
    provided. These two dicts are compared to return three sets of logGroup names that were added,
    updated or deleted.

    @param log_group_options: The logGroupOptions provided by the CloudFormation event
    @param old_log_group_options: The previous logGroupOptions that have been replaced (CF Update event)

    @type log_group_options: dict
    @type old_log_group_options: dict

    @return: Three sets of logGroup names that were added, updated or deleted from the
        old logGroupOptions dict
    @rtype: (set, set, set)
    """
    log_group_names = set(log_group_options)
    old_log_group_names = set(old_log_group_options)
    added = log_group_names.difference(old_log_group_names)
    deleted = old_log_group_names.difference(log_group_names)
    intersecting = log_group_names.intersection(old_log_group_names)
    updated = []
    for log_group in intersecting:
        if not log_group_options[log_group] == old_log_group_options[log_group]:
            updated.append(log_group)
    return added, set(updated), deleted