AWS VPC Peering
- When we create a peering connection from one vpc to another vpc (once approved), a peering connection object will be created in both vpcs.
- VPCs can be in the same region/different region, same account/different accounts. Peering will work as long as there cidr ranges dont collide.
- The basic overview is as shown below
- As of now we have two vpcs, where we can ping each other by public ip
Creating a Peering Connection
- Steps for creating a peering connection:
- Modify the Route tables in one vpc (oregon)
- Now navigate to other vpc where the peering connection needs to be approved (mumbai)
- Now modify the route table in other region (mumbai) to forward the packets (to oregon)
- Login into one ec2 instance created and ping other ec2 instance in a different vpc using private ip
- We have established the connectivity.
- Remove the following in order
- Router rules
- Peering connection
- ec2 instances
- screen shots