A two-tier web application will run in a new single-Region VPC with an internet gateway and four subnets (two public with IGW routes, two private without a default route). The app runs on EC2 instances behind an external Application Load Balancer and must not be directly reachable from the internet. The app uses an S3 bucket in the same Region for GET and PUT operations. Design a VPC architecture that minimizes data transfer costs while meeting these requirements. Which solution should the engineer choose?
Choose an answer
Tap an option to check your answer.
Correct answer: Deploy the EC2 instances in the private subnets. Create an S3 gateway endpoint in the VPC, specifying the route table of the private subnets during endpoint creation to add routes to Amazon S3..
Why this is the answer
The correct solution places EC2 instances in private subnets, ensuring they are not directly accessible from the internet, as required. Creating an S3 gateway endpoint in the VPC allows instances in the private subnets to access S3 directly and privately, without traversing the internet or a NAT Gateway. This minimizes data transfer costs because traffic to S3 over a gateway endpoint is free. The gateway endpoint automatically injects routes into the specified private subnet route tables, directing S3 traffic through the endpoint. Incorrect options: Deploying EC2 instances in public subnets violates the requirement that the application not be directly reachable from the internet. Using a NAT Gateway for S3 access incurs data processing charges for the NAT Gateway and does not offer the same cost savings as a gateway endpoint for S3. An S3 interface endpoint (powered by AWS PrivateLink) is a valid way to access S3 privately, but a gateway endpoint is generally preferred for S3 when within the same region due to its cost-effectiveness (free data transfer) and simpler configuration for this use case.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed