Question

Difficulty: EasyCost-Effective Network Routing and Data Transfer Optimization

A company hosts a machine learning application on Amazon EC2 instances inside a private subnet of a VPC. The application frequently downloads large training datasets from an Amazon S3 bucket within the same AWS Region. Currently, the EC2 instances access Amazon S3 through a NAT Gateway, which has caused a significant increase in NAT Gateway data processing charges. What is the most cost-effective network routing solution to eliminate these data processing charges?

  1. Create a gateway VPC endpoint for Amazon S3 and configure the route tables of the private subnet to direct traffic to the endpoint.Answer
  2. B
    Create an interface VPC endpoint for Amazon S3 and configure the application to route traffic through the endpoint.
  3. C
    Replace the NAT Gateway with a NAT Instance running on an Amazon EC2 instance in a public subnet.
  4. D
    Assign public IPv4 addresses to the EC2 instances and route the Amazon S3 traffic directly through an Internet Gateway.

Answer

Create a gateway VPC endpoint for Amazon S3 and configure the route tables of the private subnet to direct traffic to the endpoint.
Creating a gateway VPC endpoint for Amazon S3 is the most cost-effective solution. Gateway endpoints are free to create, do not charge for data processing, and allow instances in a private subnet to connect securely to Amazon S3 within the AWS network without traversing a NAT Gateway or going over the public internet.

Step-by-Step Solution

1
Identify the destination and the source of the traffic causing the NAT Gateway charges.
The source is EC2 instances in a private subnet, and the destination is an Amazon S3 bucket in the same Region.
Understanding the source and destination allows selecting the correct type of VPC endpoint.
2
Select the most cost-effective VPC endpoint type for Amazon S3.
Amazon S3 supports Gateway VPC Endpoints, which are available at no additional cost, unlike Interface VPC Endpoints which incur hourly and data processing fees.
Gateway endpoints are specifically designed to provide free, secure routing from a VPC to Amazon S3 and DynamoDB.
3
Route the private subnet traffic through the Gateway VPC Endpoint.
Add a route to the subnet route table pointing to the Gateway VPC endpoint (using the prefix list for S3).
This configuration ensures that S3-bound traffic bypasses the NAT Gateway and is routed directly to S3 within the AWS network.

Key Concept

Gateway VPC Endpoints for cost-effective private routing to Amazon S3
Rate this question