2. In this version of our DevOps Journey , we will demonstrate step by
step implementation of “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 by using their private Ips.
3. 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.
4. Resources required for VPC Peering :
Account Id
VPC Id
CIDR
You can find account id associated with an account as mentioned
below.
5. 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.
6. Step 1 : Click on Peering connection under VPC in one of the AWS
Account.
7. Step 2 : Now Click on Create VPC Peering connection and enter the
required details (Account ID and VPC ID of another AWS Account).
8. Step 3 : Now go back to previous account and accept request for
peering.
9. Step 4 : Modify the Route Tables for both the VPC so that VPC CIDR
can allow traffic for peering VPCs.
Route Table for VPC1 :
continue…
11. Step 5 : Launch EC2 instance in both the VPC and try to ping by its
private IPs.
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 setup VPC peering .
12. Thanks
Looking Forward for your interest in DevOpsJourney.com
http://devopsjourney.com
Email us: mail@devopsjourney.com