- VPC Peering in AWS allows private communication between instances in different Virtual Private Clouds (VPCs).
- It supports secure and low-latency network connectivity without requiring public IPs or VPNs.
- This aws vpc peering setup especially useful when setting up Amazon RDS read replicas across regions.
- With inter-region VPC peering, an application in one region can connect to an RDS replica in another region securely.
Create an RDS Read Replica in Another Region
- Go to the RDS Console.
- Select your primary RDS instance.
- Click Actions ,then Create Read Replica.
- Choose a different region ( for example , us-west-2).
- Select a subnet group in the target VPC.
- Launch the replica.
Create Inter-Region VPC Peering Connection
Go to VPC Dashboard in the source region (us-east-1):
- Navigate to Peering Connections , then choose Create Peering Connection.
- Enter a name.
- Choose the requester VPC (us-east-1) and accepter VPC (us-west-2).
- Select the appropriate account and VPC in the target region.
Accept the peering request in the target region’s VPC dashboard (us-west-2).
Update Route Tables
Each VPC must be aware of how to route traffic to the other:
In us-east-1:
- Go to the route table associated with the subnet your app resides in.
- Add a route:
Destination: 10.1.0.0/16 (CIDR of target VPC)
Target: Peering Connection ID
In us-west-2:
Do the same, but route to 10.0.0.0/16.
Modify Security Groups
Adjust security groups to allow communication.
On the RDS read replica’s security group (us-west-2):
Add an inbound rule allowing traffic from the source VPC’s subnet/IP range (10.0.0.0/16) on the appropriate port (e.g., 5432 for PostgreSQL).
On your application’s security group (us-east-1), allow outbound traffic to the target VPC subnet.
Test the Connection
On an EC2 instance in the us-east-1 VPC, try to connect:
mysql -h <read-replica-endpoint> -u <user> -p
Inter-region VPC peering is a powerful AWS networking feature that enables secure and efficient communication between VPCs in different regions. When used with Amazon RDS read replicas, it allows applications to access remote replicas without exposing them to the public internet.
Need expert help setting up AWS VPC Peering for seamless RDS replica access across regions? Our team at Skynats specializes in reliable AWS Management Services, ensuring secure, optimized, and highly available cloud infrastructure. Contact us today to simplify your AWS networking and database replication needs.