Why a VPC Gateway Endpoint for S3 Breaks Internet Access: Route Override Explained
A media company is designing a network for a new AWS environment. They have a VPC with public and private subnets in three Availability Zones. In the private subnets, they run a fleet of Amazon EC2 instances that process video files from an Amazon S3 bucket. The S3 bucket is in the same region. The company wants to ensure that all traffic to S3 stays within the AWS network and does not traverse the internet. They also need to allow the EC2 instances to access the internet for software updates, but only through a centralized NAT gateway. Currently, there is one NAT gateway in AZ1. The network engineer has created a VPC endpoint for S3 (Gateway type) and associated it with the route tables for the private subnets. However, the EC2 instances in AZ2 and AZ3 cannot reach the NAT gateway for internet access. What is the most likely cause?
Quick Answer
The correct answer is that the VPC Gateway Endpoint for S3 adds a more specific route for S3 traffic that overrides the default route to the NAT gateway, causing internet loss. When you associate a Gateway Endpoint with a private subnet’s route table, it inserts a prefix list route for the S3 service (e.g., pl-xxxxxx) that is more specific than the 0.0.0.0/0 route pointing to the NAT gateway. Because AWS route tables prioritize the most specific matching route, all traffic destined for S3—and crucially, any traffic that falls within the S3 IP range—gets sent directly to the endpoint instead of the NAT gateway. This is a classic trap on the AWS Certified Advanced Networking Specialty ANS-C01 exam: candidates often forget that a Gateway Endpoint does not just add a route for S3; it can inadvertently hijack broader internet-bound traffic if the S3 IP ranges overlap with general internet destinations. The key memory tip is “Specific beats default”—the prefix list route always wins over 0.0.0.0/0, so always verify that your internet-bound traffic still has a valid path through the NAT gateway after adding a Gateway Endpoint.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
The NAT gateway is only available in the AZ where it is deployed
The most likely cause is that the NAT gateway is only available in the AZ where it is deployed because the private subnets in AZ2 and AZ3 likely do not have a default route pointing to the NAT gateway. A NAT gateway is created in a specific AZ, and while it can be accessed from other AZs using cross-AZ routing, the route tables for those subnets must be explicitly configured with a 0.0.0.0/0 route to the NAT gateway. The S3 Gateway Endpoint adds a specific route for S3 traffic, which does not override the default route; therefore, adding the endpoint does not affect internet access. Option A is incorrect because the endpoint route is more specific for S3, not a default route. Options B and D are false because Gateway Endpoints are regional and do not require per-AZ creation, and NAT gateways can be used cross-AZ with proper routing.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The route table for private subnets now has a more specific route for S3 that overrides the default route to the NAT gateway
Why it's wrong here
The endpoint adds a route for the S3 prefix list, but if the prefix list includes 0.0.0.0/0 erroneously, or if the endpoint route is not properly scoped, it can cause issues. More commonly, the endpoint adds a route for the S3 service (e.g., com.amazonaws.<region>.s3) which does not affect the default route. However, in some configurations, if the endpoint is added with a policy that allows all traffic, it might still work. The most likely issue is that the NAT gateway route is missing or the route table does not have a default route to the NAT gateway. But among the options, B is the closest because misconfiguration can lead to the endpoint route overriding the default route.
- ✗
The VPC endpoint needs to be created in each Availability Zone
Why it's wrong here
Gateway endpoints are not per-AZ; they are regional.
- ✓
The NAT gateway is only available in the AZ where it is deployed
Why this is correct
NAT gateway is deployed in a specific AZ but can be used by instances in other AZs if the route table directs traffic to it.
- ✗
The S3 VPC endpoint is only accessible from the AZ where it was created
Why it's wrong here
Gateway endpoints are regional and accessible from all AZs.
Visual reference
Quick reference
AWS S3 Storage Class Comparison
| Storage Class | Min Duration | Retrieval | Use Case |
|---|---|---|---|
| S3 Standard | None | Immediate | Frequently accessed data |
| S3 Standard-IA | 30 days | Immediate | Infrequent access, rapid retrieval |
| S3 One Zone-IA | 30 days | Immediate | Non-critical infrequent data |
| S3 Intelligent-Tiering | None | Immediate–hours | Unknown or changing access patterns |
| S3 Glacier Instant | 90 days | Milliseconds | Archive with instant retrieval |
| S3 Glacier Flexible | 90 days | Minutes–hours | Archive, flexible retrieval |
| S3 Glacier Deep Archive | 180 days | Hours | Long-term compliance archive |
Go deeper
Related to this question
About these practice questions
Courseiva writes every ANS-C01 question from scratch — 1,621 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
Same concept, more angles
2 more ways this is tested on ANS-C01
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. A company has a VPC with a public subnet for a web server and a private subnet for a database. The web server needs to make API calls to Amazon S3. Which is the most secure way to provide this access without traffic leaving the AWS network?
medium- A.Use an AWS Site-to-Site VPN to connect to a remote network that has access to S3.
- ✓ B.Create a VPC gateway endpoint for Amazon S3 and attach it to the route table of the private subnet.
- C.Set up a NAT gateway in the public subnet and route the web server's traffic through it.
- D.Use an internet gateway and a public IP address on the web server.
Why B: A VPC gateway endpoint for Amazon S3 allows resources in a private subnet to access S3 privately using the AWS network, without traversing the internet or requiring a NAT gateway. This is the most secure option because traffic stays within the AWS backbone and does not require public IPs or external connectivity.
Variation 2. A company is designing a VPC with multiple subnets. They want to ensure that EC2 instances in a private subnet can access S3 buckets without going through a NAT Gateway or Internet Gateway. Which TWO methods can accomplish this?
medium- A.Set up a VPN connection to S3
- ✓ B.Create a Gateway VPC Endpoint for S3
- C.Use AWS Direct Connect to access S3
- ✓ D.Create an Interface VPC Endpoint for S3
- E.Attach an Internet Gateway and use a NAT Gateway
Why B: A Gateway VPC Endpoint for S3 allows EC2 instances in a private subnet to access S3 buckets privately using AWS’s internal network, without requiring an Internet Gateway or NAT Gateway. It uses prefix lists and route table entries to direct S3 traffic through the endpoint, leveraging the AWS global network for secure, low-latency access.
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This ANS-C01 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the ANS-C01 exam.