Skip to main content

Command Palette

Search for a command to run...

Day 29 : Establishing Secure Communication Between Public and Private VPCs via VPC Peering

100 Days of Cloud (AWS)

Updated
2 min read
Day 29 : Establishing Secure Communication Between Public and Private VPCs via VPC Peering
Z

I'm Zin Lin Htet. Who love to learn and share about Linux, Cloud, Docker and K8s. Currently working as a DevOps Engineer at one of the famous Fintech Company in Myanmar.

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.

100 Days of Cloud (AWS)

Part 22 of 50

In this series you will learn how to configure and manage cloud resources using AWS. My intention is to provide an explanation and share the answers for 100 Days of Cloud (AWS) from KodeKloud.

Up next

Day 28 : Creating a Private ECR Repository

100 Days of Cloud (AWS)

More from this blog

Technical 101

69 posts

"Mingalarbar , I am an IT guy from Myanmar who enjoys learning and sharing about Linux, Cloud, Docker & K8s. I am planning to share my expertise with the information technology communities in Burma