Exploring AWS VPC & VPC Peering: A Step-by-Step Hands-On Guide 🌐💡

BalaBala
3 min read

Embarked on a hands-on journey to unravel the mysteries of AWS VPC (Virtual Private Cloud) and the powerful concept of VPC Peering. Let's break down the steps taken to understand, create, and successfully implement VPCs with seamless peering.

Part One: Setting Up a Basic VPC

1. AWS Login

Logged into the AWS account to initiate the VPC setup.

2. Creating a New VPC

Started by creating a new VPC, providing a name, an IPv4 CIDR block (e.g., 10.0.0.0/16), and selecting the tenancy as default.

What is VPC?

A Virtual Private Cloud (VPC) is a virtual network dedicated to your AWS account. It provides a logically isolated section of the AWS Cloud where you can launch AWS resources in a virtual network.

3. Subnet Creation

Generated a subnet within the VPC, defining the subnet name, availability zone, and IPv4 CIDR block.

4. Internet Gateway

Created an Internet Gateway and attached it to the newly created VPC.

5. Route Table

Established a route table, associated it with the VPC, and added routes, including the Internet Gateway.

6. Launching an EC2 Instance

Launched a new EC2 instance within the created VPC, selecting the newly created subnet, and successfully accessed the instance.

Part Two: Understanding VPC Peering

What is VPC Peering?

VPC Peering in AWS enables secure and direct connections between two Virtual Private Clouds (VPCs). It allows instances in the peered VPCs to communicate seamlessly, maintaining network isolation and security. This direct link enhances the flexibility of AWS architecture, supporting various use cases such as multi-tier applications and resource sharing between VPCs.

7. Demo Setup - Prod-VPC and Test-VPC

Created another VPC named prod-vpc alongside the existing test-vpc. Followed similar steps for subnet, Internet Gateway, route table, and EC2 instance creation.

8. Testing Connectivity

Attempted to ping instances between test-vpc and prod-vpc, confirming the lack of connectivity.

9. Creating VPC Peering Connection

Initiated a VPC Peering connection, connecting test-vpc as the requester and prod-vpc as the accepter. Accepted the request to activate the connection.

10. Adjusting Routes

Edited routes in both VPCs, adding entries for the peer's IP address and targeting the VPC Peering connection.

11. Addressing Security Group

Modified the security group settings, allowing all ICMP traffic.

12. Successful Ping

Successfully achieved connectivity by pinging instances between test-vpc and prod-vpc.

Ping to test instance using prod ip address

13. Handling Private Subnets

Created a private subnet and implemented a NAT gateway in the public subnet, rounding up a comprehensive exploration of VPC and VPC Peering.

Adding NAT table route in route table

A deep dive into VPC networking—demystified! Your insights and thoughts are welcomed.

Thank you for embarking on this AWS VPC and VPC Peering journey with me! 🚀 We've explored the fundamentals, navigated through the creation steps, and uncovered the significance of seamless networking in the cloud.

Happy Cloud Computing! ☁️💡

0
Subscribe to my newsletter

Read articles from Bala directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Bala
Bala