def zone_url_to_name(zone_url):
    """Sanitize DNS zone for terraform resource names

    zone_url_to_name("mydomain.com.")
    >>> "mydomain-com"
    """
    return zone_url.rstrip(".").replace(".", "-")