Sometimes you need to connect two VPCs in AWS. In this article, I will explain how to implement that in four simple steps.
Go to: AWS Console → VPC Dashboard → Peering Connections → Click “Create Peering Connection”.
Fill in the details:
Name tag (optional): e.g., VPC-A-to-VPC-B.
VPC Requester:
Select the Requester VPC (your current VPC).
VPC Accepter:
Same account: Choose from dropdown.
Another account: Enter Account ID and VPC ID manually.
Click “Create Peering Connection”.
Same account:
In VPC → Peering Connections, select the new connection.
Click “Actions → Accept Request”.
Different account:
The owner of the Accepter VPC must log into their AWS account.
Navigate to VPC → Peering Connections.
Find the pending request and click “Accept Request”.
Go to VPC → Route Tables.
For each VPC:
Select the relevant Route Table.
Click “Routes” → Edit routes → Add route:
Destination: The CIDR block of the peer VPC.
Target: The Peering Connection ID.
Click “Save routes”.
Go to EC2 → Security Groups.
Edit the inbound rules to allow traffic from the CIDR of the peer VPC.
Type: All traffic (or specific port like HTTP, SSH)
Source: <peer VPC CIDR>
Let me integrate VPCs for you. Get a free quote here.
Credits:
Image author:
Designed by stories / Freepik