VPC Networking

AWS SAA SAA-C03 · Design Secure Architectures

By Abu Anns · Last updated 20 November 2026Exam version: SAA-C03 (current)

The VPC as your private network

An Amazon Virtual Private Cloud (VPC) is a logically isolated section of the AWS Cloud where you launch resources in a virtual network that you define. You choose the IP address range (CIDR block), divide it into subnets, control the route tables, and decide what can reach the internet and what cannot. Almost every architecture in the exam lives inside a VPC, so understanding how traffic flows through one is essential — many questions are really VPC questions wearing a different costume.

A VPC spans all the Availability Zones (AZs) in a Region, while each subnet lives in exactly one AZ. The standard pattern is to spread subnets across at least two AZs so that the failure of one AZ does not take the whole application down. Subnets are either public (their route table has a route to an internet gateway, so resources with public IPs can be reached from the internet) or private (no route to an internet gateway, so resources cannot be reached from the internet and cannot initiate outbound internet traffic on their own). The exam's classic three-tier layout puts load balancers in public subnets, application servers in private subnets, and databases in private subnets with no internet route at all.

Getting traffic in and out

An internet gateway (IGW) is the doorway between a VPC and the internet. It is highly available and horizontally scaled by AWS; you attach one per VPC and add a route (0.0.0.0/0) to it in the route tables of your public subnets. Resources in those subnets also need a public IP address or an Elastic IP to be reachable. A NAT gateway solves the opposite problem: resources in private subnets often need to initiate outbound internet traffic — to download software updates, for example — without being reachable from the internet. A NAT gateway sits in a public subnet and forwards that outbound traffic, translating the private source address to its own public one. For high availability you deploy one NAT gateway per AZ, because a NAT gateway lives in a single AZ and traffic from other AZs would cross AZ boundaries to reach it. The older NAT instance (a self-managed EC2 instance doing the same job) still appears in the exam as the option you should avoid: it is a single point of failure, needs patching, and has bandwidth limits.

Two layers of traffic control: security groups and NACLs

Every VPC has two packet-filtering mechanisms, and the exam tests the difference between them relentlessly. A security group acts as a virtual firewall at the instance level (technically, at the elastic network interface). It is stateful: if you allow an inbound request, the response traffic is automatically allowed back out, even without an explicit outbound rule. Security groups only support allow rules — there is no deny — and all rules are evaluated together, so the order does not matter. By default a security group allows all outbound traffic and denies all inbound traffic.

A network ACL (NACL) acts as a firewall at the subnet level. It is stateless: return traffic must be explicitly allowed by a separate rule, and rules are evaluated in number order, lowest first, with an explicit allow or deny decision. NACLs are the blunt instrument you use to block a specific IP address across a whole subnet, or to add a second layer of defense. The exam's rule of thumb: use security groups for the fine-grained, per-resource control, and NACLs for subnet-wide rules. When a question says traffic is blocked even though the security group allows it, check the NACL; when return traffic fails, remember the NACL is stateless.

Private access to AWS services: VPC endpoints

By default, traffic from a VPC to an AWS service such as S3 travels across the public internet. A VPC endpoint keeps that traffic on the AWS private network instead, which improves security and can reduce cost. There are two kinds. A gateway endpoint is available for S3 and DynamoDB: it is a route table entry, costs nothing, and routes traffic to the service privately. An interface endpoint (AWS PrivateLink) creates an elastic network interface with a private IP inside your subnet, and is used for most other AWS services and for private services offered by other accounts. The exam frequently asks how to reach S3 from a private subnet without an internet gateway or NAT gateway — the answer is a gateway endpoint.

Connecting VPCs and on-premises networks

When two VPCs need to talk, VPC peering connects them directly with private IP addresses. Peering is not transitive: if VPC A peers with VPC B and VPC B peers with VPC C, A and C cannot reach each other through B. Peering also cannot connect VPCs with overlapping CIDR ranges. When the number of VPCs grows, managing a mesh of peering connections becomes painful, and the answer is AWS Transit Gateway: a central hub that each VPC (and on-premises network) connects to once, with routing controlled centrally. Transit Gateway is the exam's answer for hub-and-spoke designs and for connecting dozens of VPCs.

For hybrid connectivity to an on-premises data center, there are two main options. An AWS Site-to-Site VPN creates an encrypted IPsec tunnel over the public internet: quick to set up, but bandwidth varies with the internet. AWS Direct Connect is a dedicated private network connection from your premises into AWS: consistent bandwidth, lower latency, and traffic that never touches the public internet, but it takes weeks to provision and costs more. A common exam pattern combines them: Direct Connect as the primary path with a VPN as the backup. AWS VPN CloudHub and Transit Gateway VPN attachments appear for connecting multiple branch offices.

Visibility: VPC Flow Logs

VPC Flow Logs capture information about the IP traffic going to and from network interfaces in a VPC. They record metadata — source, destination, port, protocol, whether the traffic was accepted or rejected — not packet contents. Flow logs are the exam's answer whenever a question asks how to diagnose why traffic is being blocked, audit network access, or investigate a security incident. They can be published to CloudWatch Logs or to S3.

IPv6 and egress-only internet gateways

VPCs support IPv6 alongside IPv4. An IPv6 address is globally unique and publicly routable, so instances with IPv6 addresses can be reached from the internet unless a firewall rule prevents it. An egress-only internet gateway is the IPv6 equivalent of a NAT gateway: it lets instances in private subnets initiate outbound IPv6 traffic while blocking inbound connections from the internet. The exam rarely goes deep on IPv6, but the concept matters: dual-stack VPCs need both an internet gateway (for IPv4) and, for private outbound IPv6, an egress-only internet gateway.

One more pattern worth knowing is VPC sharing, where a central network account shares subnets with other accounts in the same AWS Organization. Each participant account launches resources into the shared subnets, while the owner account keeps control of the network layout, route tables, and flow logs. Sharing reduces the number of VPCs to manage and keeps network design consistent, but it requires careful planning of IP address space, since the shared subnets must have room for every participant's resources.

Advertisement

Exam traps to watch for

Practice questions

Test yourself on this guide. Answers are checked instantly, with a full explanation for each question.

Q1.A company runs application servers on EC2 instances in private subnets. The instances need to download security patches from the internet, but they must not be reachable from the internet. Which solution meets these requirements?

Report an error

Q2.A security group allows inbound traffic on port 443 from 0.0.0.0/0, and its outbound rules allow all traffic. A network ACL on the subnet allows inbound traffic on port 443 but has no outbound rule for the return traffic. A user tries to reach a web server in the subnet over HTTPS. What happens?

Report an error

Q3.A company has EC2 instances in private subnets with no internet gateway and no NAT gateway. The instances need to read objects from Amazon S3. Which solution provides this access MOST cost-effectively while keeping traffic off the public internet?

Report an error

Q4.A company is migrating a latency-sensitive application to AWS. The application must communicate with the company's on-premises data center over a connection with consistent bandwidth that does not traverse the public internet. Which solution should the solutions architect recommend?

Report an error

Q5.A company has 15 VPCs across three AWS accounts that all need to communicate with each other and with the on-premises network. The network team wants to avoid managing a mesh of individual connections. Which solution BEST meets this requirement?

Report an error

Q6.A solutions architect is designing a three-tier web application. Which subnet placement follows AWS best practice for security?

Report an error

Q7.Users report that they cannot reach an application on an EC2 instance. The security group allows the required port, and the instance is running. The network engineer wants to see whether the traffic is reaching the instance and whether it is being rejected. Which AWS feature provides this information?

Report an error

Q8.A company runs an application in a private subnet that must call an AWS service API which does NOT support gateway endpoints. The company does not want the API traffic to cross the public internet. Which solution meets this requirement?

Report an error