A company has a fleet of Amazon EC2 instances running in a private subnet that daily upload of data to an Amazon S3 bucket in the same AWS Region. Currently, the EC2 instances route this traffic through a NAT Gateway, which has led to high data processing charges. Which solution is the most cost-effective way to route this traffic and eliminate the NAT Gateway data processing charges?
- Create a gateway VPC endpoint for Amazon S3 and configure the route table of the private subnet to point to the endpoint.Answer
- BDeploy an interface VPC endpoint (AWS PrivateLink) for Amazon S3 in the private subnet and update the route table.
- CProvision a NAT Instance in a public subnet to replace the NAT Gateway and route the traffic through it.
- DConfigure an AWS Transit Gateway to route the S3 traffic from the private subnet to the S3 bucket.
Answer
Create a gateway VPC endpoint for Amazon S3 and configure the route table of the private subnet to point to the endpoint.
The correct solution is to create a gateway VPC endpoint for Amazon S3 and configure the route table of the private subnet. Gateway VPC endpoints are provided by AWS at no additional cost and do not charge for data processing. By routing the S3-bound traffic through the gateway endpoint, the traffic stays within the AWS network and bypasses the NAT Gateway entirely, eliminating the NAT Gateway's data processing fees.
Step-by-Step Solution
Key Concept
Gateway VPC Endpoints provide a secure, cost-free path (with no hourly or data processing charges) to connect a VPC to Amazon S3 and Amazon DynamoDB, bypassing expensive NAT Gateways.