Readyset Cloud
VPC Peering

title: VPC Peering

VPC Peering

If your application is behind a VPC without public IP access, you will need to configure VPC peering. You need to configure these steps:

Create Cluster

Create a cluster with VPC Peering Enabled

Create VPC Peering Cluster

VPC Information

  1. A form asking for your private VPC information will appear. Be sure to fill out the correct AWS Account ID, VPC-ID (the VPC that your upstream database is sitting in), your CIDR block (this is the CIDR that is associated with the VPC-ID), and then your desired cluster CIDR block This CIDR value must be different from your upstream VPC's CIDR block. We default it to 172.0.0/16 to avoid CIDR conflicts

VPC Peering Info

Application peering

If your application that needs to access Readyset is in a different VPC from your upstream database, you can select this option and fill out the peering information for your application. In this case, you have two peering connections that are active with the Readyset cluster - one for your upstream database and one for your application

VPC Peering Application Settings

Private Connection String

You will then fill out your connection string information, which is the full connection string pointing to the private DNS of your upstream database, and then create the cluster

VPC Peering Connection String

VPC Peering Script

While the cluster is creating, you will be given explicit instructions in the UI to complete the peering steps:

VPC Peering Connection String

Note: Make sure you are logged into the correct AWS Account to complete this step.

To follow these instructions, you will copy the command that is provided to you in the UI, then go to cloudshell in the AWS account and region where your upstream database is running. From there, you will run the commands, which automatically downloads a script that accepts the peering request sent from Readyset to your database VPC and configures your route tables and CIDR block to allow Readyset to connect.

VPC Peering Connection String

From here, the peering steps are complete and your cluster will come up successfully with an active VPC peering connection.

VPC Peering Steps Complete

We will need to add the Requester CIDRs block to all routing tables assigned to your VPC. Navigate to the Routing tables ( VPC > Route tables ) and filter all routing tables for your VPC:

VPC Peering Filter VPC

Enter each one of your routing tables by clicking the routing table ID:

VPC Peering Route Table Select

In the Route Table detailed view, select Edit routes:

VPC Peering Edit Route

Add the VPC Peering CIDRs block noted before in the Destination field, set the target to Peering Connection, select the respective peering connection ID noted when accepting VPC peering request and click Save changes:

VPC Peering Save Route

Repeat this process for all routing tables on this VPC.

Configure Security Group

Your security group needs to be configured to allow:

  1. Your database to inbound traffic from Readyset CIDR block on your PostgreSQL port (Default 5432):

Go to RDS > Databases and select the the writer instance of your RDS cluster. In the Connectivity & Security tab and click on your security group (You might have more than one security group. Any security group you select is ok):

VPC Peering Security Group Inbound Select

Click in the Security group ID to enter your Security Group:

VPC Peering Security Group Inbound Enter

Select Inbound rules tab and click Edit inbound rules

VPC Peering Security Group Inbound Edit

Click Add rule button. In Type field select PostgreSQL, in Source field select Custom, add the VPC Peering Requester CIDR block and click Save rules.

VPC Peering Security Group Inbound Save

Now Readyset cloud has all the necessary configuration to communicate with your RDS instance.

  1. Your application to outbound traffic to Readyset CIDR block on port 5433.

Readyset uses port 5433 for application traffic. In order for your application to connect to Readyset you need to configure your app Security Group.

Navigate to your application instance (eg.: ec2) select Security tab and click on your security group (You might have more than one security group. Any security group you select is ok):

VPC Peering Security Group Outbound Save

Select Outbound rules tab and click Edit outbound rules

VPC Peering Security Group Inbound Edit

Click Add rule button. In Type field select Custom TCP, in Port range type 5433, in Source field select Custom, add the VPC Peering Requester CIDR block and click Save rules

VPC Peering Security Group Outbound Save

Now your application should be able to connect to Readyset cloud.

Note: Navigate to Readyset Cloud control panel and wait for your cache instance status to appear as Healthy.

VPC Peering Cluster Healthy