VPC Design Best Practices: Network Architecture Guide

VPC design decisions made early in a project are difficult to change later. Getting CIDR planning, subnet strategy, and security architecture right from the start prevents painful migrations. This guide covers best practices for VPC design at scale.

CIDR Planning

Non-Overlapping Ranges

The most critical rule: Plan for connectivity from day one.

CIDR Size Recommendations

VPC Type Recommended CIDR Available IPs
Small application /24 251 per subnet
Standard workload /20 4,091 per /24 subnet
Large production /16 65,531 total

IP Address Management (IPAM)

Use AWS VPC IPAM or similar for centralized control:

# Example CIDR allocation scheme
10.0.0.0/8 (Corporate supernet)
├── 10.0.0.0/12  (Production)
│   ├── 10.0.0.0/16  (us-east-1 prod)
│   ├── 10.1.0.0/16  (eu-west-1 prod)
│   └── 10.2.0.0/16  (Reserved)
├── 10.16.0.0/12 (Development)
│   ├── 10.16.0.0/16 (us-east-1 dev)
│   └── 10.17.0.0/16 (Reserved)
└── 10.32.0.0/12 (On-premise)

Subnet Strategy

Subnet Types

VPC: 10.0.0.0/16
├── Public Subnets (internet-facing)
│   ├── 10.0.0.0/24  (AZ-a) - ALB, NAT Gateway
│   ├── 10.0.1.0/24  (AZ-b)
│   └── 10.0.2.0/24  (AZ-c)
├── Private Subnets (application tier)
│   ├── 10.0.10.0/24 (AZ-a) - Containers, EC2
│   ├── 10.0.11.0/24 (AZ-b)
│   └── 10.0.12.0/24 (AZ-c)
├── Data Subnets (database tier)
│   ├── 10.0.20.0/24 (AZ-a) - RDS, ElastiCache
│   ├── 10.0.21.0/24 (AZ-b)
│   └── 10.0.22.0/24 (AZ-c)
└── Transit Subnets (TGW attachment)
    ├── 10.0.100.0/28 (AZ-a)
    ├── 10.0.100.16/28 (AZ-b)
    └── 10.0.100.32/28 (AZ-c)

Subnet Sizing

Multi-AZ Design

Always Deploy Across AZs

AZ-Independent Design

# Each AZ should be independently functional
AZ-a                    AZ-b                    AZ-c
├── ALB node           ├── ALB node           ├── ALB node
├── NAT Gateway        ├── NAT Gateway        ├── NAT Gateway
├── App instances      ├── App instances      ├── App instances
└── Cache replica      └── Cache replica      └── Cache primary

Security Architecture

Security Group Design

# Good: Reference security groups
alb-sg → app-sg (port 8080)
app-sg → db-sg (port 5432)
app-sg → cache-sg (port 6379)

# Avoid: CIDR-based rules
10.0.0.0/16 → 10.0.0.0/16 (all ports)

Network ACLs

Connectivity Patterns

Internet Access

Public Subnet:
└── Route: 0.0.0.0/0 → Internet Gateway

Private Subnet:
└── Route: 0.0.0.0/0 → NAT Gateway (in public subnet)

Isolated Subnet:
└── No internet route (VPC endpoints for AWS services)

VPC Endpoints

Priority endpoints to deploy:

Multi-Account Strategy

Account per Environment

Networking Account
├── Transit Gateway
├── Direct Connect
└── Shared Services VPC

Production Account
└── Prod VPC → TGW attachment

Staging Account
└── Staging VPC → TGW attachment

Development Account
└── Dev VPC → TGW attachment

Benefits

Naming and Tagging

Consistent Naming Convention

# Pattern: {app}-{env}-{region}-{resource}-{az}
vpc:        myapp-prod-use1-vpc
subnet:     myapp-prod-use1-private-a
rt:         myapp-prod-use1-private-rt
sg:         myapp-prod-use1-app-sg
natgw:      myapp-prod-use1-natgw-a

Required Tags

Documentation Checklist

Key Takeaways

Need VPC Design Review?

We review and optimize VPC architectures. Contact us for a consultation.