Fermin Perdomo

Senior Full Stack Engineer | PHP | JavaScript

How create peering connection to connect two VPCs in AWS

Fermin Perdomo
June 24, 2025

Sometimes you need to connect two VPCs in AWS. In this article, I will explain how to implement that in four simple steps.

Step-by-Step Guide

Step 1:  Create VPC Peering Connection

  1. Go to: AWS Console → VPC DashboardPeering 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”.

Step 2: Accept the Peering Connection

Same account:

  1. In VPC → Peering Connections, select the new connection.
  2. Click “Actions → Accept Request”.

Different account:

  1. The owner of the Accepter VPC must log into their AWS account.
  2. Navigate to VPC → Peering Connections.
  3. Find the pending request and click “Accept Request”.

Step 3: Update Route TablesYou must allow traffic between VPCs by updating their route tables.

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”.

Repeat this for the other VPC’s route table.Step 4: Update Security Groups (Optional but likely needed)
Go to EC2 → Security Groups.
Edit the inbound rules to allow traffic from the CIDR of the peer VPC.
Example:
Type: All traffic (or specific port like HTTP, SSH)
Source: <peer VPC CIDR>
Do this on both sides.

Let me integrate VPCs for you. Get a free quote here.

Credits:
Image author:
Designed by stories / Freepik

Reactions

Loading reactions...
Log in to react to this post.

Comments

Please login to leave a comment.

Great Tools for Developers

Git tower

Git tower

A powerful Git client for Mac and Windows that simplifies version control.

Get Started - It's Free
Visit Tool
Mailcoach's

Mailcoach's

Self-hosted email marketing platform for sending newsletters and automated emails.

Start free
Visit Tool
Uptimia

Uptimia

Website monitoring and performance testing tool to ensure your site is always up and running.

Start free
Visit Tool

Newsletter