Learn AWS VPC design best practices for CIDR planning, subnets, routing, security, connectivity, and scalable network architectures.
A poorly planned AWS network can become difficult to scale, secure, and troubleshoot as infrastructure grows. AWS VPC design involves planning IP address ranges, subnets, routing, security controls, and network connectivity within a Virtual Private Cloud. A sound design helps applications communicate securely while supporting availability and future expansion.
For example, an application that initially runs in one VPC may later require multiple accounts, on-premises connectivity, or centralized traffic inspection. These changes become harder when the original network has overlapping CIDRs, unclear subnet boundaries, or incomplete routing.
This guide explains how to plan an AWS VPC, choose suitable network patterns, and avoid common design problems.
An Overview
- What Should You Consider Before Designing an AWS VPC?
- How to Plan AWS VPC CIDR Ranges and Subnets
- How to Design AWS VPC Routing and Network Traffic
- AWS VPC Security Best Practices
- AWS VPC Reference Architectures: Five Common Design Patterns
- How to Choose the Right AWS VPC Connectivity Model
- How to Monitor and Maintain AWS VPC Infrastructure
- Common AWS VPC Design Mistakes to Avoid
- AWS VPC Design Review Checklist
What Should You Consider Before Designing an AWS VPC?
Start with application and operational requirements rather than choosing subnet ranges immediately. Identify the network paths the application needs and the boundaries that must remain protected.
Consider these questions:
- Inbound traffic: Which components need internet access? Can a public load balancer handle external requests?
- Outbound traffic: Which workloads need internet access? Can they reach AWS services through private endpoints?
- Availability: How many Availability Zones should support production workloads?
- IP capacity: How many addresses and network interfaces do current and future workloads require?
- Connectivity: Will the VPC connect to other VPCs or on-premises networks?
- Security: Do workloads require separate network or security boundaries?
These requirements guide decisions about CIDR allocation, subnet placement, routing, and connectivity.
How to Plan AWS VPC CIDR Ranges and Subnets
Choose the Right VPC CIDR Range
CIDR planning affects how easily an AWS network can expand. Overlapping address ranges can prevent direct connectivity between VPCs and complicate hybrid networking.
When selecting a CIDR range:
- Choose a range that accommodates current workloads and expected growth.
- Reserve address space for additional subnets and services.
- Avoid overlaps with other VPCs and connected on-premises networks.
- Account for managed services and temporary workloads.
- Decide whether the architecture requires IPv4, IPv6, or dual-stack support.
Planning address space early reduces the risk of redesigning the network when connectivity requirements change.
Design Public and Private Subnets
Subnets divide a VPC into smaller network segments. Their boundaries should reflect workload roles and expected traffic paths.
A common production layout separates resources into three tiers:
- Public subnets: Host internet-facing components, such as an Application Load Balancer or NAT Gateway.
- Private application subnets: Host application workloads that should not receive direct inbound internet traffic.
- Private data subnets: Host databases, caches, and other data services.
Distribute equivalent subnet tiers across multiple Availability Zones. This allows application components to operate across zones and supports a more resilient architecture.
A subnet is not public merely because of its name. Its route table must provide a path to an Internet Gateway, and its resources must have appropriate network addressing and security rules.
How to Design AWS VPC Routing and Network Traffic
Route tables determine where traffic goes after leaving a subnet. Each route should have a clear destination and target.
Common routing targets include:
| Component | Typical purpose |
|---|---|
| Local route | Enables communication within the VPC. |
| Internet Gateway (IGW) | Provides an internet path for public resources. |
| NAT Gateway | Allows private IPv4 workloads to initiate outbound internet connections. |
| Gateway endpoint | Provides supported private access to services such as S3 and DynamoDB. |
| Interface endpoint | Provides private access to supported AWS services through PrivateLink. |
| Transit Gateway | Connects multiple VPCs and hybrid networks. |
| VPN or Direct Connect | Supports connectivity with on-premises networks. |
For every important connection, review both forward and return routes. A route that supports traffic in only one direction cannot provide reliable connectivity.
Configure Internet Egress for Private Subnets
Private IPv4 workloads commonly use NAT Gateways for outbound internet access. A production design can place a NAT Gateway in each Availability Zone used by private subnets. This avoids relying on another zone for the normal egress path.
However, not every AWS service request needs to pass through NAT. Where supported, VPC endpoints provide private access to AWS services and reduce dependencies on public egress paths.
For IPv6 workloads, explicitly plan the outbound path. An egress-only Internet Gateway can support outbound IPv6 connections without allowing internet-initiated connections.
Access AWS Services Privately Through VPC Endpoints
VPC endpoints allow workloads to access supported AWS services without relying on public internet connectivity.
Two common types are:
- Gateway endpoints: Used for supported services such as Amazon S3 and DynamoDB.
- Interface endpoints: Use AWS PrivateLink to provide private connectivity to supported services through network interfaces in selected subnets.
Consider endpoints when they can remove unnecessary NAT dependencies or provide a more controlled service-access path. Endpoint policies can further restrict access through an endpoint, but they do not replace IAM permissions.
AWS VPC Security Best Practices
Security controls should reflect the role of each subnet and workload. Avoid relying on one control to protect the entire network.
Use Security Groups for Workload-Level Access
Security groups are stateful controls associated with resources or network interfaces. Use them to restrict communication between application tiers.
For example, an application server security group can allow database connections only from the application tier. Avoid broad inbound rules that expose services to unnecessary sources.
Apply Network ACLs Where Subnet-Level Controls Are Needed
Network ACLs operate at the subnet level and are stateless. They support ordered allow and deny rules.
Because they are stateless, administrators must account for return traffic separately. Keep rules understandable and use NACLs where additional subnet-level guardrails are necessary.
Enable VPC Flow Logs for Network Visibility
VPC Flow Logs record information about IP traffic to and from supported network interfaces, subnets, or VPCs. They help troubleshoot connectivity and investigate traffic patterns.
Flow Logs provide visibility, not traffic blocking. Use them alongside appropriate security controls and operational monitoring.
Plan Centralized Network Inspection Carefully
AWS Network Firewall or another approved inspection layer can help organizations inspect selected network traffic centrally.
However, inspection must be part of the routing design. Both forward and return paths must traverse the intended inspection components. Asymmetric routing can disrupt stateful inspection.
AWS VPC Reference Architectures: Five Common Design Patterns
The right architecture depends on workload size, isolation requirements, and connectivity needs.
1. Two-AZ Web Application
A common pattern places an Application Load Balancer in public subnets and application servers in private subnets across two Availability Zones.
The traffic path runs from the internet through the Internet Gateway to the load balancer, which forwards requests to the private application tier.
Private workloads can use NAT Gateways for outbound IPv4 traffic and VPC endpoints for supported AWS services.
2. Three-Tier Multi-AZ Application
Applications with separate web, application, and data layers can use dedicated subnet tiers across multiple Availability Zones.
Keep the data tier private and restrict communication between tiers through security groups. Size subnet ranges to accommodate application growth and additional capacity.
3. Multi-VPC Hub-and-Spoke
Organizations operating multiple VPCs or AWS accounts can use AWS Transit Gateway as a central routing point.
Spoke VPCs connect to the Transit Gateway, while Transit Gateway route tables control communication between attachments. This approach supports centralized connectivity and clearer network segmentation.
4. Hybrid AWS VPC
Organizations that connect AWS workloads to on-premises networks can use Site-to-Site VPN or AWS Direct Connect.
A Transit Gateway can connect multiple VPCs with these hybrid links. The design must include complete routing on both sides, including return routes to the original network.
5. Centralized Egress and Inspection
Some environments route outbound traffic from multiple VPCs through a shared inspection and egress network.
Spoke VPCs send selected traffic through a Transit Gateway to an inspection VPC and then to the approved egress path. This centralizes policy enforcement, but adds routing complexity. Stateful inspection requires particular attention to return paths.
How to Choose the Right AWS VPC Connectivity Model
Choose a connectivity model based on the number of networks, routing requirements, and operational complexity.
| Connectivity model | Suitable scenario | Main consideration |
|---|---|---|
| Single VPC | Workloads with limited connectivity needs. | Keep subnet and security boundaries clear. |
| VPC Peering | A small number of VPCs need direct communication. | Peering does not support transitive routing. |
| Transit Gateway | Multiple VPCs, accounts, or hybrid connections. | Requires deliberate route-table and segmentation design. |
| Site-to-Site VPN | Encrypted connectivity to on-premises networks. | Plan routing and connection availability. |
| Direct Connect | Dedicated private connectivity to AWS. | Design redundancy according to availability requirements. |
VPC Peering can work well for a few direct connections. However, managing many individual connections becomes more difficult as the network expands. Transit Gateway is more suitable when multiple VPCs and hybrid networks need centralized routing.
How to Monitor and Maintain AWS VPC Infrastructure
A VPC design needs operational visibility and controlled change management.
Use these practices:
- Monitor network traffic: Enable VPC Flow Logs and use CloudWatch to monitor relevant service and application metrics.
- Track configuration changes: Use AWS CloudTrail to review API activity and network-related changes.
- Manage infrastructure as code: Use Terraform or another IaC tool to version, review, and maintain network configurations.
- Document routing: Keep route tables, connectivity paths, and network diagrams current.
- Test failure scenarios: Validate how workloads respond to Availability Zone, NAT Gateway, endpoint, and connectivity failures.
These practices help teams identify unexpected traffic paths and investigate changes more effectively.
Common AWS VPC Design Mistakes to Avoid
Watch for these problems during architecture reviews:
- Overlapping CIDR ranges: These can restrict future VPC and hybrid connectivity.
- Single-AZ production deployments: A zonal failure can remove critical application capacity.
- Flat subnet layouts: Poor separation makes traffic boundaries harder to enforce.
- Broad inbound rules: Unrestricted access increases unnecessary exposure.
- Console-only changes: Untracked changes make reviews and rollback harder.
- Incomplete routing: Missing return routes can break otherwise valid connections.
- Unplanned inspection paths: Asymmetric routing can disrupt stateful network inspection.
AWS VPC Design Review Checklist
Before deploying a VPC, verify the following:
CIDR ranges support current workloads and future expansion.
Planned VPCs avoid address overlap.
CIDR ranges support current workloads and future expansion.
Planned VPCs avoid address overlap.
Production workloads span the required Availability Zones.
Public, application, and data subnet roles are clearly defined.
Internet-facing resources have justified exposure.
Private workloads have only the required egress paths.
Supported AWS services use appropriate VPC endpoints.
Forward and return routes are documented.
Security group rules follow least-privilege principles.
NACL rules account for return traffic.
Flow Logs and monitoring support troubleshooting.
Hybrid connectivity includes on-premises return routes.
Network changes are version-controlled and reviewed.
Failure scenarios have been tested.
Conclusion
Effective AWS VPC design begins with application requirements, not a predefined network template. Address planning, subnet separation, routing, security controls, and connectivity choices should work together as one architecture.
A simple VPC may suit an initial deployment. As infrastructure expands, Transit Gateway, hybrid connectivity, or centralized inspection may become necessary. Regular reviews, infrastructure as code, and failure testing help keep the network secure, manageable, and ready for growth.