def set_yb_sg_and_fetch_vpc(metadata, region, dest_vpc_id):
    'Method to bootstrap vpc and security group, and enable vpc peering\n    with the host_instance vpc.\n    Args:\n        metadata (obj): Cloud metadata object with cidr prefix and other metadata.\n        region (str): Region name to create the vpc in.\n        dest_vpc_id (str): Id of the VPC that yugabyte machines will reside in.\n    Returns:\n        vpc_info (json): return vpc, subnet and security group as json.\n    '
    client = get_client(region)
    dest_vpc = client.Vpc(dest_vpc_id)
    subnets = {subnet.availability_zone: subnet for subnet in dest_vpc.subnets.all()}
    sg_group_name = get_yb_sg_name(region)
    rules = metadata['sg_rules']
    for r in rules:
        r.update({'cidr_ip': IGW_CIDR})
    add_cidr_to_rules(rules, dest_vpc.cidr_block)
    sgs = [create_security_group(client=client, group_name=sg_group_name, vpc=dest_vpc, description='YugaByte SG', rules=rules)]
    return vpc_components_as_json(dest_vpc, sgs, subnets)
Method to bootstrap vpc and security group, and enable vpc peering
with the host_instance vpc.
Args:
    metadata (obj): Cloud metadata object with cidr prefix and other metadata.
    region (str): Region name to create the vpc in.
    dest_vpc_id (str): Id of the VPC that yugabyte machines will reside in.
Returns:
    vpc_info (json): return vpc, subnet and security group as json.
def set_yb_sg_and_fetch_vpc(metadata, region, dest_vpc_id):
    'Method to bootstrap vpc and security group, and enable vpc peering\n    with the host_instance vpc.\n    Args:\n        metadata (obj): Cloud metadata object with cidr prefix and other metadata.\n        region (str): Region name to create the vpc in.\n        dest_vpc_id (str): Id of the VPC that yugabyte machines will reside in.\n    Returns:\n        vpc_info (json): return vpc, subnet and security group as json.\n    '
    client = get_client(region)
    dest_vpc = client.Vpc(dest_vpc_id)
    subnets = {subnet.availability_zone: subnet for subnet in dest_vpc.subnets.all()}
    sg_group_name = get_yb_sg_name(region)
    rules = metadata['sg_rules']
    for r in rules:
        r.update({'cidr_ip': IGW_CIDR})
    add_cidr_to_rules(rules, dest_vpc.cidr_block)
    sgs = [create_security_group(client=client, group_name=sg_group_name, vpc=dest_vpc, description='YugaByte SG', rules=rules)]
    return vpc_components_as_json(dest_vpc, sgs, subnets)