def get_zones(region, dest_vpc_id=None):
    'Method to fetch zones for given region or all the regions if none specified.\n    Args:\n        region (str): Name of region to get zones of.\n    Returns:\n        zones (obj): Map of zone -> subnet\n    '
    result = {}
    filters = get_filters('state', 'available')
    client = boto3.client('ec2', region_name=region)
    zones = client.describe_availability_zones(Filters=filters).get('AvailabilityZones', [])
    new_client = get_client(region)
    zone_mapping = {}
    for z in zones:
        zone_name = z['ZoneName']
        zone_tag = SUBNET_PREFIX_FORMAT.format(zone_name)
        region_vpc = None
        if dest_vpc_id:
            region_vpc = new_client.Vpc(dest_vpc_id)
        else:
            region_vpc = get_vpc(new_client, RESOURCE_PREFIX_FORMAT.format(region))
        subnet = next(iter(fetch_subnets(region_vpc, zone_tag)), None)
        if (subnet is None):
            subnet = next(iter([s for s in region_vpc.subnets.all() if (s.availability_zone == zone_name)]), None)
        zone_mapping[zone_name] = (subnet.id if (subnet is not None) else None)
    return zone_mapping
Method to fetch zones for given region or all the regions if none specified.
Args:
    region (str): Name of region to get zones of.
Returns:
    zones (obj): Map of zone -> subnet
def get_zones(region, dest_vpc_id=None):
    'Method to fetch zones for given region or all the regions if none specified.\n    Args:\n        region (str): Name of region to get zones of.\n    Returns:\n        zones (obj): Map of zone -> subnet\n    '
    result = {}
    filters = get_filters('state', 'available')
    client = boto3.client('ec2', region_name=region)
    zones = client.describe_availability_zones(Filters=filters).get('AvailabilityZones', [])
    new_client = get_client(region)
    zone_mapping = {}
    for z in zones:
        zone_name = z['ZoneName']
        zone_tag = SUBNET_PREFIX_FORMAT.format(zone_name)
        region_vpc = None
        if dest_vpc_id:
            region_vpc = new_client.Vpc(dest_vpc_id)
        else:
            region_vpc = get_vpc(new_client, RESOURCE_PREFIX_FORMAT.format(region))
        subnet = next(iter(fetch_subnets(region_vpc, zone_tag)), None)
        if (subnet is None):
            subnet = next(iter([s for s in region_vpc.subnets.all() if (s.availability_zone == zone_name)]), None)
        zone_mapping[zone_name] = (subnet.id if (subnet is not None) else None)
    return zone_mapping