Question

Difficulty: EasyVPC Connectivity and Routing Troubleshooting

A SysOps administrator configures a new gateway VPC endpoint for Amazon S3 to enable private access for Amazon EC2 instances in a private subnet. After deploying the endpoint, the administrator notices that the EC2 instances are still routing their traffic to Amazon S3 through an existing NAT gateway. Which of the following is the most likely cause of this behavior?

  1. The route table associated with the private subnet was not selected during the gateway endpoint creation.Answer
  2. B
    A route targeting the Internet Gateway (IGW) was not added to the private subnet's route table.
  3. C
    The Network Access Control List (NACL) for the private subnet does not allow outbound traffic on ephemeral ports.
  4. D
    The gateway VPC endpoint must be configured to route traffic through the NAT gateway to reach S3.

Answer

The route table associated with the private subnet was not selected during the gateway endpoint creation.
A gateway VPC endpoint works by automatically adding a route to the associated route tables that directs traffic destined for Amazon S3 (using its prefix list) to the endpoint. If the administrator does not select the private subnet's route table during creation, the route table will not contain the prefix list entry, and traffic to S3 will continue to match the default route (0.0.0.0/0) pointing to the NAT gateway.

Step-by-Step Solution

1
Analyze how gateway VPC endpoints direct traffic.
Gateway endpoints work by adding a route to the specified route tables targeting the AWS service prefix list (e.g., pl-xxxxxx) with the gateway endpoint ID (vpce-xxxxxx) as the target.
This direct route is necessary to override the default 0.0.0.0/0 route pointing to the NAT gateway.
2
Determine why the traffic continues to route to the NAT gateway.
If the private subnet's route table was not selected (associated) during the creation of the gateway endpoint, the S3 prefix list route will not be added to that route table.
Without the specific prefix list route in the table, traffic to S3 will fall back to the default route (0.0.0.0/0) which points to the NAT gateway.

Key Concept

Gateway VPC endpoints require explicit route table association to add prefix list routing.
Rate this question