AWS-VPC Peering

Hi ,

http://www.devopsjourney.com/2015/08/understand-cross-account-vpc-peering-in-aws/

Welcome to the DevopsJourney.com.
In this version of our DevOps Journey , we will demonstrate step by step implementation of understand cross account vpc peering in aws . “Cross Account VPC Peering in AWS” . It means Account A’s VPC will be peered to Account B’s VPC. After Peering we’ll be able to communicate EC2 instances in VPC of Account A from Instances in VPC of Account B.

Limitations :

There are few limitations and rules which needs to follow while VPC peering.
  • VPCs which are going to be peered shouldn’t have matching or overlapping CIDR blocks.
  • VPC peering are not allowed for VPCs in different regions.
  • VPC transitivity is not allowed. For Example : VPC A is peered to VPC B and VPC B is peered to VPC C, it doesn’t mean that A will be automatically peered to C.
You can also check http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-peering.html for more information.
Resources required for VPC Peering :
  • Account Id
  • VPC Id
  • CIDR
You can find account id associated with an account as mentioned below.
1_accountid




To know about VPC ID and VPC CIDR , check as mentioned below :

So above information was related to one AWS Account . Now we’ll Sign in to another AWS Account and will start peering this VPC.
Step 1 : Click on Peering connection under VPC in one of the AWS Account.
2_vpcid

Step 2 : Now Click on Create VPC Peering connection and enter the required details (Account ID and VPC ID of another AWS Account).

4_start_peering

Step 3 : Now go back to previous account and accept request for peering.
5_accept_request

Step 4 : Modify the Route Tables for both the VPC so that VPC CIDR can allow traffic for peering VPCs.
Route Table for VPC1 :
6_route_table_1








Route Table for VPC2 :
7_route_table_2







Step 5 : Launch EC2 instance in both the VPC and try to ping by its private IPs.
8_ping






We can see instance having private ip 172.31.14.192 is able to communicate to instance with private ip 10.0.1.146 .
So this is how we can understand cross account vpc peering in aws .
This was all about our post. Let us know if you have any questions, suggestions, feedback. We ‘ll surely look into this.


Thanks.
— Ishant
Share with your network.

Comments

Popular posts from this blog

How To Know Which Program To Use To Open An Unknown File Extension

Step By Step: Install and Configure Sensu + Grafana

Hosting a WordPress Blog with Amazon Linux