Amazon VPC Peering

Amazon VPC

Project Overview:

VPC Peering is an AWS networking feature that allows two VPCs to communicate using private IP addresses. It’s ideal for connecting environments like development and production, or linking services across accounts. Peering is non-transitive, meaning if VPC A peers with B and B peers with C, A cannot talk to C unless explicitly peered.

Steps taken to complets this project :

1. Plan Your VPC's

Amazon VPC
Amazon VPC
Amazon VPC
Amazon VPC
Amazon VPC
Amazon VPC

- Ensure non-overlapping CIDR blocks between the two VPCs.
- Decide whether the VPCs are in the same account or different ones.
- Confirm region compatibility if doing cross-region peering.


2. Create the Peering Connection

Amazon VPC
Amazon VPC
Amazon VPC
Amazon VPC
Amazon VPC
Amazon VPC
Amazon VPC

- Go to the VPC Dashboard in AWS.
- Choose “Peering Connections” → “Create Peering Connection.”
- Select the requester VPC and specify the accepter VPC (can be in another account or another region).
- Add a name tag for clarity.


3. Accept the Peering Request


Amazon EC2
Amazon VPC
Amazon VPC
Amazon VPC

- In the accepter account (or same account), go to Peering Connections.
- Find the pending request and click “Accept.”


4. Update Route Table


Amazon EC2
Amazon EC2
Amazon VPC
Amazon VPC
Amazon VPC
Amazon VPC
Amazon VPC

- In both VPCs, go to Route Tables.
- Add a route that points to the peer VPC’s CIDR block via the peering connection.
- This enables traffic flow between VPCs.

5. Create Amazone EC2 instances


AmazonEC2
Amazon EC2
Amazon EC2
Amazon EC2
Amazon EC2
Amazon EC2

- Update security goups rules to allow traffic from the peer VPC's CIDR.
- Launch EC2 instances in both VPC's


6. Test the connection

Amazon EC2
Amazon EC2

- SSH into them using their public IP .


Key Features

- Secure communication without traversing the public inetrnet.
- Low latency and cost effective data transfer
- Cross account and region support

Considerations

- VPC peering does not support transitive routing.
- You can't use overlapping CIDR blocks.
- for complex architectures, consider Transit Gateway as an alternative