Today I will explain a new feature of Amazon Web Services, VPC peering. VPC peering allows us to connect our different VPCs with each other in a single region. We can route our traffic between our own different VPCs and also between different AWS accounts (you can use VPC peering for connecting to your clients/partner network or maybe you have some different accounts for just financial/billing purposes) . There are some limits that a VPC can have peering connections up to 50 other VPCs in the same region. And also we can not use overlapping CIDR blocks and transitive peering is not allowed. For other limitations you can visit this link.
Let’s configure our VPC peering between different VPCs. First of all you have to use the new dashboard for VPC, otherwise you won’t be able to see the peering connections tab.
In “Create VPC Peering Connection”, first of all we will give a name tag to our peering. In “Local VPC to Peer” option we will choose which VPC we want to connect to other VPC. In “Select a VPC to peer with” option we can use either our own VPCs or as I mentioned before you can create peering with your clients,partners etc. I will use my account here in my example. And finally we will choose the “VPC ID”, other VPC we want to connect. If you choose “Another account” option you have to enter the account ID of your peering account like “Account Number 1305-xxxx-xxxx”.
As you see now our VPC peering connection is a requested state and says that “the owner of the other VPC needs to acccept” to make it active.
Ok, let’s accept the request.
And it is active now.
Now we have to configure our route tables for the subnets in that VPCs.
If you have any question or comment please feel free to write. Also if you want to test VPC peering with another account, I can help you by providing my account id.