Overview
AWS VPC peering establishes private IP connectivity between your application VPC and the VPC containing your PlanetScale Managed deployment. Traffic uses the AWS network instead of traversing the public internet. PlanetScale will send a peering request to your AWS account, configure routes and database access in the Managed VPC, and authorize your VPC to use a Route 53 private hosted zone. In your AWS console you will need to accept the request and configure routes and network access in your VPC, and associate your VPC with the private hosted zone.VPC peering is available for PlanetScale Managed deployments on AWS. Contact your PlanetScale Solutions Engineer to confirm that it is appropriate for your network architecture. Peering does not disable the public database endpoint; clients must use the dedicated private hostname to connect over the peering connection.
Prerequisites
Before requesting a peering connection:- Install and configure the AWS CLI. The AWS CLI is required to associate your VPC with the private hosted zone.
- Confirm that you own the VPC. Participants in a shared VPC cannot accept peering requests.
- Your VPC’s IPv4 CIDR blocks must not overlap the PlanetScale Managed VPC’s IPv4 CIDR blocks. PlanetScale provides the Managed VPC CIDR blocks.
- Enable both
enableDnsSupportandenableDnsHostnameson your VPC. In the Amazon VPC console, select Your VPCs, select your VPC, then select Actions and Edit VPC settings. Enable both DNS resolution and DNS hostnames, then save your changes. For AWS CLI instructions, see View and update DNS attributes for your VPC. - Identify every route table used by clients that connect to PlanetScale.
- Review security groups and network ACLs for database traffic:
- Vitess uses TCP ports
443and3306. - Postgres uses TCP ports
443,5432, and6432.
- Vitess uses TCP ports
Step 1: Initiate the setup
Contact your PlanetScale Solutions Engineer and provide:- Your AWS account ID
- The AWS Region of your VPC
- Your VPC ID
- Every IPv4 CIDR block associated with your VPC
- The VPC peering connection ID, which starts with
pcx- - The AWS account ID and VPC ID of the PlanetScale side of the connection
- The PlanetScale Managed VPC CIDR blocks
- The Route 53 private hosted zone ID
- The private hosted zone name
- Your dedicated private database hostname
Step 2: Accept the VPC peering request
The peering request remains inpending-acceptance for seven days. Accept it in the Region containing your VPC.
- AWS Console
- AWS CLI
1
Open the Amazon VPC console and select the Region containing your VPC.
2
In the navigation pane, select Peering connections.
3
Select the peering connection ID supplied by PlanetScale. Confirm that its status is Pending acceptance, the requester account and VPC match the information from PlanetScale, and the accepter account and VPC are yours.
4
Select Actions, then Accept request. Confirm the request.
5
Wait for the connection status to become Active.
Step 3: Configure routes and network access
Add a route to each route table associated with clients that connect to PlanetScale. The destination is a PlanetScale Managed VPC CIDR block and the target is the VPC peering connection.- AWS Console
- AWS CLI
1
In the Amazon VPC console, select Route tables.
2
Select a route table associated with a client subnet, then select Actions and Edit routes.
3
Add a route with a PlanetScale Managed VPC CIDR block as the Destination and the peering connection as the Target.
4
Save the route and repeat these steps for every Managed VPC CIDR block and client route table supplied by PlanetScale.
Step 4: Associate the private hosted zone
VPC peering does not automatically change how the dedicated database hostname resolves. PlanetScale creates a Route 53 private hosted zone containing the private database records and authorizes your VPC to use it. You must complete the cross-account association. After your Solutions Engineer confirms that PlanetScale created the association authorization, run:INSYNC.
Verify the association:
Step 5: Verify DNS and database connectivity
Run DNS and connection tests from a resource in a subnet that uses the configured route table. Use the dedicated private database hostname supplied by your Solutions Engineer:- Vitess hostnames end in
.private-connect.psdb.cloud. - Postgres hostnames end in
.private-pg.psdb.cloud.
AmazonProvidedDNS resolves the private hosted zone automatically. If your clients use a custom DNS resolver, ask your infrastructure team to configure conditional forwarding for the private hosted zone through a Route 53 Resolver inbound endpoint in your VPC.
- MySQL
- Postgres
mysql> prompt.The CA root path depends on your operating system. See the CA root configuration documentation for the correct path.
- Confirm that the peering connection and routes are
active. - Confirm that the route tables associated with the client subnets contain every Managed VPC CIDR block.
- Confirm that security groups and network ACLs allow the database connection and return traffic.
- Ask your Solutions Engineer to verify the return routes and access controls in the Managed VPC.

