def _get_hostedzone_id(r53_client, domain):
    """Get the hosted zone id for a Route53 domain.

    Parameters
    ----------
    domain : str
        Name of the domain to locate.

    Returns
    -------
    str or None
        HostedZoneId of the Route53 hosted zone or None if it doesn't exist.
    """
    hosted_zones = r53_client.list_hosted_zones()['HostedZones']
    print('Searching for hosted zone {}'.format(domain))
    for hosted_zone in hosted_zones:
        if hosted_zone['Name'] == domain:
            return hosted_zone['Id']
    return None
