DEV Community

Cover image for "Step-by-Step Guide: Manually Setting up a Peering Connection between Mumbai and Northern Virginia Regions in AWS"
Puneet Jena
Puneet Jena

Posted on

"Step-by-Step Guide: Manually Setting up a Peering Connection between Mumbai and Northern Virginia Regions in AWS"

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

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

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

  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

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

  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.

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.


Use the private IP address of the database server in the Mumbai region to establish a connection and perform any required database operations.

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.

Top comments (0)