Projects

Creating a VPC with Public and Private EC2 Instances

VPC
EC2
Networking

Building a basic AWS network architecture using a VPC, public/private subnets, EC2 instances, Internet Gateway and NAT Gateway.

Introduction

In this project I created a basic AWS networking architecture using a custom VPC and two EC2 instances located in different subnets.

The objective was to understand:

  • VPC networking fundamentals
  • subnet segmentation
  • public vs private resources
  • internet connectivity
  • NAT Gateway behavior
  • route table associations

This project is especially useful for:

  • networking fundamentals
  • cloud architecture learning
  • infrastructure design practice
  • VPC understanding

Services Used

The project uses the following AWS services:

  • Amazon VPC
  • Amazon EC2
  • Internet Gateway
  • NAT Gateway
  • Route Tables

Architecture

The architecture consists of:

Internet

Internet Gateway

Public Subnet

NAT Gateway

Private Subnet

The public subnet hosts an EC2 instance with internet access.

The private subnet hosts another EC2 instance with outbound access through NAT Gateway.

Configuration

The infrastructure was configured using:

  • custom VPC
  • public subnet
  • private subnet
  • route tables
  • Internet Gateway
  • NAT Gateway
  • EC2 deployment

Additional concepts explored:

  • subnet isolation
  • internet routing
  • outbound-only connectivity
  • traffic segregation

Important Considerations

Some important networking concepts:

Public Subnet
0.0.0.0/0 → Internet Gateway
Private Subnet
0.0.0.0/0 → NAT Gateway

Additional considerations:

  • private instances remain inaccessible from the internet
  • route tables define connectivity
  • NAT only supports outbound communication

Lessons Learned

This project helped reinforce:

  • VPC architecture
  • subnet design
  • route tables
  • internet connectivity
  • NAT Gateway behavior
  • network isolation

References

Final Result

Network Graph

Project Code

You can find the Terraform code used in this project in the following GitHub directory.

View Terraform Directory

Comments

Loading comments...
Loading...