"Step-by-Step Guide: Manually Setting up a Peering Connection between Mumbai and Northern Virginia Regions in AWS"
Published: 2023-07-10 13:03:07

**Step 1: Prepare your AWS Account**

1. Ensure you have an AWS account and necessary permissions to create and manage VPC resources.

**Step 2: Create VPCs**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uijta8pkocqf7xa1gufz.png)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2qtv02stspxs5zannykl.png)

1.In the AWS Management Console, navigate to the VPC Dashboard in 
  the Mumbai region (ap-south-1).

- 1. Create a VPC in the Mumbai region with a CIDR block of your 
     choice. Note down the VPC ID.

- 2. Repeat the same process to create a VPC in the Northern 
    Virginia region (us-east-1) and note down its VPC ID.

 
**Step 3: Create Subnets**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/43ytva400o3589vz31vb.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d0ibr2bh8ojlmisodf61.png)

In the Mumbai region, go to the VPC Dashboard and select "Subnets" from the sidebar.

1. - Create a public subnet within the Mumbai VPC, specifying a 
    CIDR block that falls within the VPC's CIDR range. Note down 
    the subnet ID.
2. - Repeat the same process to create a database subnet withi
     the Mumbai VPC.

**Step 4: Create Security Groups**

In the Mumbai region, go to the EC2 Dashboard and select "Security Groups" from the sidebar.

1. - Create a security group for the public server, allowing inbound connections on the desired ports (e.g., HTTP, SSH).
2. - Create another security group for the database server, allowing inbound connections only from the public server's security group.

**Step 5: Launch Instances**


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pzhqy0v0iheyaerypj7t.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l17s7sb3yo77zm1mo593.png)

1. - In the Mumbai region, launch an EC2 instance for the public server, placing it in the public subnet. Assign the appropriate security group.
2. - Launch another EC2 instance for the database server, placing it in the database subnet. Assign the appropriate security group.

**Step 6: Create a VPC Peering Connection**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1ykmsrk9og1ura5pcme9.png)

In the Mumbai region, go to the VPC Dashboard and select "Peering Connections" from the sidebar.

1. - Click "Create Peering Connection" and specify the VPC ID of the Mumbai VPC.
2. - Repeat the same process in the Northern Virginia region, specifying the VPC ID of the Northern Virginia VPC.
3. - Once both peering connections are created, note down their peering connection IDs.

**Step 7: Accept Peering Connection Requests**

1. - In the Mumbai region, select the peering connection created in the Northern Virginia region.
2. - Click "Actions" and choose "Accept Request" to accept the peering connection.
3. - Repeat the same process in the Northern Virginia region, accepting the peering connection request from the Mumbai region.

**Step 8: Update Route Tables**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7viah22ogyg8phnyfwsd.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nych28bx13nredu65r83.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n6f0ax9i282pbu4bilx5.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/anrlulhpausl7o30u4xd.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2th8nbcsirlbf8t44y52.png)

1. -  In the Mumbai region, go to the VPC Dashboard and select "Route Tables" from the sidebar.
2. - Choose the route table associated with the Mumbai VPC and click "Edit Routes."
3. - Add a route to the Northern Virginia VPC's CIDR block via the peering connection ID.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rm7lrkzd5a7kecw61jvw.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6ohdu48z9xev7olvupjw.png)

4.- In the Northern Virginia region, repeat the process to update the route table associated with the Northern Virginia
 VPC.

**Step 9: Test Connectivity**

1. - Connect to the public server in the Northern Virginia region via SSH or RDP.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/skib8czs71uwmuoqywzv.png)
Use the private IP address of the database server in the Mumbai region to establish a connection and perform any required database operations.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sdoy8r3ij3t7nc15j0wu.png)

That's it! You have successfully set up a peering connection manually between the Mumbai and Northern Virginia regions in AWS. Remember to clean up any resources you no longer need to avoid unnecessary costs.