Check if a set of AWS resource tags is contained in another

    Every tag key in `expected` must be present in `actual`, and have the same
    value. Extra keys in `actual` but not in `expected` are ignored.

    Args:
        actual (list): Set of tags to be verified, usually from the description
            of a resource. Each item must be a `dict` containing `Key` and
            `Value` items.
        expected (list): Set of tags that must be present in `actual` (in the
            same format).

def check_tags_contain(actual, expected):
    """Check if a set of AWS resource tags is contained in another

    Every tag key in `expected` must be present in `actual`, and have the same
    value. Extra keys in `actual` but not in `expected` are ignored.

    Args:
        actual (list): Set of tags to be verified, usually from the description
            of a resource. Each item must be a `dict` containing `Key` and
            `Value` items.
        expected (list): Set of tags that must be present in `actual` (in the
            same format).
    """

    actual_set = set((item["Key"], item["Value"]) for item in actual)
    expected_set = set((item["Key"], item["Value"]) for item in expected)

    return actual_set >= expected_set