Gateway VPC Endpoint for S3: Private Subnet Connectivity
A company has a VPC with public and private subnets. An EC2 instance in a private subnet needs to access an S3 bucket in the same Region. Which solution provides the most secure and cost-effective connectivity?
Quick Answer
The correct answer is to create a gateway endpoint for S3 in the VPC and add a route in the private subnet’s route table pointing to the endpoint. This works because a gateway endpoint uses AWS’s private network to connect the VPC directly to S3, keeping traffic entirely within the AWS backbone and avoiding internet exposure, all at no additional cost. On the AWS Certified Advanced Networking Specialty ANS-C01 exam, this question tests your understanding of VPC endpoint types and their appropriate use cases—specifically that S3 and DynamoDB support gateway endpoints, not interface endpoints. A common trap is assuming a NAT gateway is needed for private subnet connectivity, but that introduces cost and security risks. Remember the memory tip: “S3 and DynamoDB go through the gateway—no IP, no cost, no internet.”
⚠ Common exam trap
The ANS-C01 exam often tests the misconception that a NAT gateway is required for private subnet internet access, but for S3 in the same Region, a gateway endpoint is both more secure and cost-effective, and candidates may overlook the free, private connectivity option.
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
✓
Create a gateway endpoint for S3 in the VPC and add a route in the private subnet's route table pointing to the endpoint.
A gateway endpoint for S3 uses Amazon's private network to connect the VPC to S3 without traversing the internet, providing the most secure and cost-effective solution. It avoids NAT gateway hourly charges and data processing fees, and it does not require public IPs or internet access for the private subnet EC2 instance.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Create a NAT gateway in a public subnet and add a route in the private subnet's route table pointing to the NAT gateway.
Why it's wrong here
A NAT gateway incurs hourly charges and data processing costs, and traffic goes over the internet.
- ✗
Create an interface endpoint for S3 in the private subnet.
Why it's wrong here
Interface endpoints are not available for S3; S3 uses gateway endpoint type.
- ✗
Attach an internet gateway to the VPC and add a route to the internet gateway in the private subnet's route table.
Why it's wrong here
This would allow the instance to access the internet, which is less secure and not required for S3 access in the same Region.
- ✓
Create a gateway endpoint for S3 in the VPC and add a route in the private subnet's route table pointing to the endpoint.
Why this is correct
A gateway endpoint provides private, cost-effective access to S3 without internet connectivity.
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
3 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 and a private subnet. An EC2 instance in the private subnet needs to download patches from an S3 bucket in the same region. The company wants to minimize data transfer costs and avoid traversing the internet. Which solution should the company implement?
medium- A.Create a VPC Interface Endpoint for S3 and attach it to the private subnet.
- B.Configure an S3 bucket policy to allow access from the VPC and use an Internet Gateway.
- ✓ C.Create a VPC Gateway Endpoint for S3 and attach it to the private subnet's route table.
- D.Create a NAT Gateway in the public subnet and route traffic to the S3 bucket through it.
Why C: A VPC Gateway Endpoint for S3 provides private, cost-free connectivity to S3 from within a VPC without traversing the internet. It uses prefix-based routing via the route table, ensuring traffic to S3 stays within the AWS network, minimizing data transfer costs and avoiding internet egress charges.
Variation 2. A company has a VPC with a public subnet and a private subnet. An EC2 instance in the private subnet needs to download patches from an S3 bucket. The company wants to minimize data transfer costs and avoid traversing the internet. Which solution should be implemented?
medium- A.Use an Interface VPC Endpoint for S3
- B.Use AWS Direct Connect
- C.Set up a NAT Gateway in the public subnet and route traffic through it
- ✓ D.Create a Gateway VPC Endpoint for S3
Why D: A Gateway VPC Endpoint for S3 allows EC2 instances in a private subnet to access S3 without traversing the internet, using AWS's internal network. This minimizes data transfer costs because Gateway Endpoints are free and traffic stays within the AWS backbone, avoiding NAT Gateway or internet gateway charges.
Variation 3. A company has a VPC with a public subnet and a private subnet. An EC2 instance in the private subnet needs to access an S3 bucket. The company wants to ensure that traffic to S3 does not traverse the internet. Which solution should a network engineer implement?
medium- A.Create a VPC interface endpoint for S3 and attach it to the private subnet.
- B.Deploy an S3 VPN endpoint in the VPC.
- ✓ C.Create a VPC gateway endpoint for S3 and add a route to the S3 prefix list via the endpoint.
- D.Set up a NAT gateway in the public subnet and add a route to the S3 prefix list via the NAT gateway.
Why C: A VPC gateway endpoint for S3 allows instances in a private subnet to access S3 privately using AWS's internal network, without traversing the internet. By adding a route to the S3 prefix list via the gateway endpoint, traffic destined for S3 is directed through the endpoint, which uses AWS's private backbone. This solution is cost-effective and does not require a NAT gateway or internet gateway.
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.