The Complete Beginner’s Guide to AWS Networking

The Complete Guide to AWS Virtual Private Cloud (VPC) and Networking

I want to summarize everything I’ve learned about Networking in Amazon Web Services (AWS) in the form of notes, but in a detailed and simple way. This post is meant as a revision for myself and as a helpful guide for anyone else who is learning like I am. Let’s get started.

What is a Network?

Computer networks allow devices to connect and exchange data. To regulate this data exchange, we rely on several concepts: IP addresses, subnets, ports, routers, etc. When we learn these concepts in the context of AWS, things become more abstract because instead of physical devices, we use “virtual components.”

VPC and Subnet Architecture

A VPC (Virtual Private Cloud) is a private network space within AWS. It’s like building your own virtual data center inside AWS. Within this network space, we can run servers (EC2), databases, storage services, and more. The most important feature of a VPC is that it’s isolated from other users.

CIDR Block Example:

CIDRDescription
10.0.0.0/16Provides 65,536 IP addresses
10.0.1.0/24Contains 256 IP addresses

We can divide subnets into two types:

  • Public Subnet: Connected to an Internet Gateway, allows external access.
  • Private Subnet: Used for internal resources, not accessible from the outside.

Routing Tables

Each subnet must be associated with a routing table. These tables define how inbound and outbound traffic is directed.

Example:

Subnet TypeDestinationTarget Gateway
Public Subnet0.0.0.0/0Internet Gateway
Private Subnet0.0.0.0/0NAT Gateway (optional)

Security Structures: Security Groups and NACLs

AWS provides two key network security mechanisms:

  • Security Group: Applied at the instance level; stateful.
  • Network ACL (NACL): Applied at the subnet level; stateless.

Comparison Table:

FeatureSecurity GroupNetwork ACL
Level of ApplicationEC2 (Instance)Subnet
StatefulYesNo
Deny Rules SupportedNoYes
Rule Evaluation OrderIrrelevantBased on rule number

Internet and NAT Gateways

  • Internet Gateway: Allows public subnets to connect to the internet.
  • NAT Gateway: Allows private subnets to access the internet without accepting incoming traffic.

High Availability

To improve system reliability, distribute your subnets across multiple Availability Zones (AZs). For example:

  • us-east-1a → public subnet
  • us-east-1b → private subnet

Site-to-Site VPN

  • Virtual Private Gateway: The AWS side
  • Customer Gateway: The on-premises network side
  • This connection creates a secure tunnel between your corporate network and AWS.

VPC Endpoints and PrivateLink

TypeUse CaseCostNotes
Gateway EndpointS3, DynamoDBFreeWorks with route tables
Interface EndpointAll AWS servicesPaidCreates an Elastic Network Interface

VPC Peering

Used to create private connections between two VPCs. Important points:

  • CIDR blocks must not overlap
  • No transitive routing
  • Routing tables must be updated on both sides

Additional AWS Network Services

ServiceDescription
Route 53DNS management
CloudFrontContent delivery network (CDN)
API GatewayManagement of RESTful and WebSocket APIs

Example Use Case

VPC: 10.0.0.0/16

  • 2 AZs: us-east-1a, us-east-1b
  • Public Subnet (10.0.1.0/24): EC2 web servers
  • Private Subnet (10.0.2.0/24): RDS database

Routing Table:

SubnetDestinationGateway
Public0.0.0.0/0Internet Gateway
Private0.0.0.0/0NAT Gateway

Security Group Settings:

ResourcePortsDescription
Web Server443, 80, 22HTTPS, HTTP, SSH (admin IP only)
RDS3306Accessible only from EC2 internal IP

In this system, you can also use CloudFront for static content delivery, Route 53 for domain routing, and API Gateway to expose services to the public. If corporate connectivity is required, you can establish a Site-to-Site VPN for secure communication.

These notes aim to summarize AWS VPC and Networking topics for both beginners and intermediate learners. While there are automation templates available, understanding the core concepts is essential. I hope this helps anyone learning like I am.

Leave a Reply

Your email address will not be published. Required fields are marked *