π οΈ Legendary AWS VPC Peering Project
Welcome to the Legendary AWS Networks VPC Peering Project! This detailed guide will walk you through the process of creating secure, private communication between two isolated Virtual Private Clouds (VPCs) in AWS. Weβll use Terraform to automate the entire process while ensuring scalability, efficiency, and best practices.
π Project Overview
In this project, we will:- Provision two VPCs with unique CIDR blocks.
- Establish a VPC Peering connection between the two VPCs.
- Update route tables to allow traffic flow between the VPCs.
- Launch EC2 instances in both VPCs for connectivity testing.
- Test private communication between instances in separate VPCs.
- Optionally clean up resources after testing.
πΉ Key Concept:
VPC Peering allows secure, private communication between two isolated networks without using the public internet.
VPC Peering allows secure, private communication between two isolated networks without using the public internet.
π£οΈ Process Flow
Hereβs a visual flowchart of the VPC Peering setup process:π οΈ Step-by-Step Guide
βοΈ Step 1: Provision VPCs
-
Create two VPCs with the following CIDR blocks:
-
VPC 1:
10.1.0.0/16 -
VPC 2:
10.2.0.0/16
-
VPC 1:
- Enable DNS resolution and hostnames for both VPCs.
- Configure public subnets in each VPC to allow external access.
ποΈ Step 2: Establish VPC Peering Connection
- Initiate the VPC Peering request from VPC 1 (Requester).
- Accept the request in VPC 2 (Accepter).
-
Verify that the peering connection status is
active.
π£οΈ Step 3: Configure Route Tables
-
Update the route table in VPC 1:
- Add a route to direct traffic to VPC 2βs CIDR (
10.2.0.0/16) via the peering connection.
- Add a route to direct traffic to VPC 2βs CIDR (
-
Update the route table in VPC 2:
- Add a route to direct traffic to VPC 1βs CIDR (
10.1.0.0/16) via the peering connection.
- Add a route to direct traffic to VPC 1βs CIDR (
π» Step 4: Launch Test EC2 Instances
-
Launch an EC2 instance in each VPC:
- VPC 1 Instance: Amazon Linux 2, Public Subnet
- VPC 2 Instance: Amazon Linux 2, Public Subnet
- Assign security groups to allow ICMP (ping) traffic between instances.
π Step 5: Test Connectivity
- Use EC2 Instance Connect to SSH into the EC2 instance in VPC 1.
-
Run a
pingtest to the private IP address of the EC2 instance in VPC 2. -
Ensure successful connectivity:
- Output: Packets transmitted successfully.
πΉ Troubleshooting:
If the ping test fails, check security group rules and route table configurations.
If the ping test fails, check security group rules and route table configurations.
πͺ© Cleanup (Optional)
If youβre done testing:- Delete the VPC peering connection.
- Terminate the EC2 instances.
- Remove route table entries.
- Delete the VPCs to avoid incurring charges.
π Highlights
- Automation: Use Terraform to automate the entire process.
π§ Contact
For questions or feedback, reach out: π¨ Email: [email protected] π Portfolio: Brian Kimemia GitHub: BrianKN019Thank you for exploring this project! Letβs innovate and build secure AWS solutions together. π