steps to create vpc peering

Create AWS VPC peering connection in 6 simple steps




Here are the steps to create AWS VPC peering connection

A VPC peering connection allows you to route traffic between the peer VPCs using private IP addresses; as if they are part of the same network. I’ve covered detailed information on my article on AWS VPC Peering, This how to do with show how to create AWS VPC peering connection in 6 simple steps.


Step 1: Select the VPC’s  to be peered 

vpcpeering-creation
GO TO VPC OPTION IN YOUR AWS ACCOUNT, THERE YOU WILL FIND “PEERING CONNECTION” OPTION ON LEFT SIDE. IN THAT CLICK ON “CREATE VPC PEERING CONNECTION” BUTTON, YOU’LL GET THIS WINDOW

Step 2: Review the peering connection information

vpc-peered-confirmation
CONFIRM THE DETAILS OF YOUR VPC AND THE VPC TO BE PEERED WITH.

Step 3 :  Accept the VPC peering request

vpcpeering-request
ACCEPT THE REQUEST, IF YOU ARE DOING PEERING WITH OTHER ACCOUNT THEN THE OTHER ACCOUNT WILL RECEIVE THE REQUISITION FOR PEERING.

Step 4 : Review the request before accepting it as you won’t be able to revert back once accepted!

accept-request-cnf
CHECK AND CONFIRM THE INFORMATION AND THEN ACCEPT THE REQUEST.

Step 5 : Edit the route tables of both VPC’s (IMP)

route-table
YOU’LL HAVE TO ADD NETWORK RANGE WITH CIDR OF THE OTHER VPC INTO BOTH VPC’S ROUTE TABLE BY SELECTING THE APPROPRIATE VPC PEERING ID IN TARGET FIELD.

Step 6 : Once done check the security group to make sure you have SSH port open for instances in both VPC’s.

Try to perform SSH to the instance in other peered VPC, It should work!

$ssh -i "xyz.pem" ec2-user@10.0.0.2

Note : If it doesn’t work, please check your route table entries.

If your trying to access an RDS instance than make sure you enable DNS resolution. You can do that by editing source Peering connection.

Select VPC peering connection( the one which you created first) -> go to edit DNS settings option

enable-DNS-resolution-vpc-peering

Make sure you do this on the Peering connection which you create a first not the one which you sent request to, otherwise it won’t work.

For more info visit AWS documentation for VPC peering, For information on VPC peering scenarios visit this link : http://docs.aws.amazon.com/AmazonVPC/latest/PeeringGuide/peering-configurations-full-access.html

References :

http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-peering.html

http://docs.aws.amazon.com/AmazonVPC/latest/PeeringGuide/peering-configurations-full-access.html

http://docs.aws.amazon.com/AmazonVPC/latest/PeeringGuide/Welcome.html