Day 29 : Establishing Secure Communication Between Public and Private VPCs via VPC Peering
100 Days of Cloud (AWS)

Welcome to Day 29. Today, we will learn how to create a VPC peering connection between two VPCs. The VPC and related EC2 instances are already set up in this lab. You just need to focus on the peering connection between the two VPCs.
What is VPC peering connection?
An AWS VPC Peering Connection is a networking connection between two Virtual Private Clouds (VPCs) that allows you to route traffic between them using private IP addresses. Once peered, resources in either VPC (like EC2 instances or RDS databases) can communicate as if they were on the same local network.







cd .ssh/
ls
cat id_rsa.pub





I can't ping the private EC2 instance's IP from the public EC2 instance because they are currently in two different VPCs and networks.











In this step, you need to add a new route in the private vpc‘s route table. Please enter the public VPC's CIDR range and choose the peering connection we already created.



In this step, you need to add a new route in the public vpc’s route table. Please enter the private VPC's CIDR range and choose the peering connection we already created.




After the peering connection is set up, you can ping the private EC2 instance's IP from the public EC2 instance.



Congratulations you did it. It looks good. This lab was successfully completed without any errors. See you in day 30. If you have any issues please let me know I will be happy to assist you. Stay tuned and learn together. If you find my article useful, please kindly like and share it.




