'Return zone id which name is closer matched with domain name.'

@staticmethod
def get_best_match_zone(all_zones, domain):

    public_zones = [zone for zone in all_zones['HostedZones'] if (not zone['Config']['PrivateZone'])]
    zones = {zone['Name'][:(-1)]: zone['Id'] for zone in public_zones if (zone['Name'][:(-1)] in domain)}
    if zones:
        keys = max(zones.keys(), key=(lambda a: len(a)))
        return zones[keys]
    else:
        return None
