def create_subnet(client, vpc, zone, cidr, tag_name):
    'Method to create subnet based on cidr and tag name.\n    Args:\n        client (boto client): Region specific boto client\n        vpc (VPC object): VPC object to create subnet.\n        zone (str): Availability zone name\n        cidr (str): CIDR string\n        tag_name (str): Tag name for subnet.\n    Returns:\n        subnet: Newly created subnet object.\n    '
    subnet = next((s for s in fetch_subnets(vpc, tag_name) if (s.cidr_block == cidr)), None)
    if (subnet is None):
        subnet = vpc.create_subnet(CidrBlock=cidr, AvailabilityZone=zone)
        client.meta.client.get_waiter('subnet_available').wait(SubnetIds=[subnet.id])
        tag_resource_name(client, subnet.id, tag_name)
    return subnet
Method to create subnet based on cidr and tag name.
Args:
    client (boto client): Region specific boto client
    vpc (VPC object): VPC object to create subnet.
    zone (str): Availability zone name
    cidr (str): CIDR string
    tag_name (str): Tag name for subnet.
Returns:
    subnet: Newly created subnet object.
def create_subnet(client, vpc, zone, cidr, tag_name):
    'Method to create subnet based on cidr and tag name.\n    Args:\n        client (boto client): Region specific boto client\n        vpc (VPC object): VPC object to create subnet.\n        zone (str): Availability zone name\n        cidr (str): CIDR string\n        tag_name (str): Tag name for subnet.\n    Returns:\n        subnet: Newly created subnet object.\n    '
    subnet = next((s for s in fetch_subnets(vpc, tag_name) if (s.cidr_block == cidr)), None)
    if (subnet is None):
        subnet = vpc.create_subnet(CidrBlock=cidr, AvailabilityZone=zone)
        client.meta.client.get_waiter('subnet_available').wait(SubnetIds=[subnet.id])
        tag_resource_name(client, subnet.id, tag_name)
    return subnet