Project: YugabyteDB (App Definition and Development / Database)
File: cloud-add-vpc-gcp.md

title: Peer VPCs in GCP headerTitle: Peer VPCs linkTitle: Peer VPCs description: Peer a VPC in GCP. headcontent: Peer your cluster VPC with a VPC in GCP menu: preview_yugabyte-cloud: identifier: cloud-add-vpc-1-gcp parent: cloud-add-peering weight: 50 type: docs <ul class="nav nav-tabs-alt nav-tabs-yb"> <li> <a href="../cloud-add-vpc-aws/" class="nav-link"> <i class="fa-brands fa-aws" aria-hidden="true"></i> AWS </a> </li> <li> <a href="../cloud-add-vpc-gcp/" class="nav-link active"> <i class="fa-brands fa-google" aria-hidden="true"></i> GCP </a> </li> </ul> YugabyteDB Managed supports peering virtual private cloud (VPC) networks on AWS and GCP. Using YugabyteDB Managed, you can create a VPC on GCP, deploy clusters in the VPC, and peer the VPC with application VPCs hosted on GCP. To peer VPCs in GCP, you need to complete the following tasks: | Task | Notes | | : | : | | | Reserves a range of private IP addresses for the network.<br>The status of the VPC is Active when done. | | | Connects your VPC and the application VPC on the cloud provider network.<br>The status of the peering connection is Pending when done. | | | Confirms the connection between your VPC and the application VPC.<br>The status of the peering connection is Active when done. | | | This can be done at any time - you don't need to wait until the VPC is peered. | | | Allows the peered application VPC to connect to the cluster.<br>Add at least one of the CIDR blocks associated with the peered application VPC to the for your cluster. | With the exception of completing the peering in GCP, these tasks are performed in YugabyteDB Managed. For information on VPC network peering in GCP, refer to in the Google VPC documentation. To avoid cross-region data transfer costs, deploy your VPC in the same region as the application VPC you are peering with. {{< tip title="What you need" >}} The CIDR range for the application VPC with which you want to peer, as the addresses can't overlap. Where to find it<br>Navigate to the GCP page. {{< /tip >}} To create a VPC, do the following: On the Networking page, select VPC Network, then VPCs. Click Create VPC to display the Create VPC sheet. Enter a name for the VPC. Choose the provider (GCP). Choose one of the following options: Automated - VPCs are created globally and GCP assigns network blocks to each region supported by YugabyteDB Managed. (Not recommended for production, refer to in the GCP documentation.) Custom - Select a region. Click Add Region to add additional regions. If the VPC is to be used for a multi-region cluster, add a region for each of the regions in the cluster. . CIDR addresses in different regions can't overlap. For Automated, use network sizes of /16, /17, or /18. For Custom, use network sizes of /24, /25, or /26. Ensure the address does not overlap with that of the application VPC. Click Save. YugabyteDB Managed adds the VPC to the with a status of

If successful, after a minute or two, the status will change to Active. The VPC's network name and project ID are automatically assigned. You'll need these details when configuring the peering in GCP. After creating a VPC in YugabyteDB Managed that uses GCP, you can peer it with a GCP application VPC. {{< tip title="What you need" >}} The following details for the GCP application VPC you are peering with: GCP project ID VPC name VPC CIDR address Where to find it<br>Navigate to your GCP page. {{< /tip >}} To create a peering connection, do the following: On the Networking page, select VPC Network, then Peering Connections. Click Add Peering Connection to display the Create Peering sheet. Enter a name for the peering connection. Choose GCP. Choose the YugabyteDB Managed VPC. Only VPCs that use GCP are listed. Enter the GCP Project ID, application VPC network name, and, optionally, VPC CIDR address. Click Initiate Peering. The peering connection is created with a status of Pending. To complete a Pending GCP peering connection, you need to sign in to GCP and create a peering connection. {{< tip title="What you need" >}} The Project ID and VPC network name of the YugabyteDB Managed VPC you are peering with. Where to find it<br>The VPC Details sheet on the or the Peering Details sheet on the . {{< /tip >}} In the Google Cloud Console, do the following: Under VPC network, select and click Create Peering Connection. Click Continue to display the Create peering connection details. Enter a name for the GCP peering connection. Select your VPC network name. Select In another project and enter the Project ID and VPC network name of the YugabyteDB Managed VPC you are peering with. Click Create. When finished, the status of the peering connection in YugabyteDB Managed changes to Active if the connection is successful. You can deploy a cluster in the VPC any time after the VPC is created. To deploy a cluster in a VPC: On the Clusters page, click Add Cluster. Choose Dedicated. Enter a name for the cluster, choose GCP, and click Next. For a Single-Region Deployment, choose the region where the VPC is deployed, and under Configure VPC, choose Use VPC peering, and select your VPC. For a Multi-Region Deployment, select the regions where the cluster is to be deployed, then select the VPC. The same VPC is used for all regions. For more information on creating clusters, refer to . To enable the peered application VPC to connect to the cluster, you need to add the peered VPC to the cluster IP allow list. To add the application VPC to the cluster IP allow list: On the Clusters page, select the cluster you are peering, click Actions, and choose Edit IP Allow List to display the Add IP Allow List sheet. Click Add Peered VPC Networks. Click Save when done. For more information on IP allow lists, refer to .