Interview Prep/Networking/VPC & Cloud Network Design

Your private subnet instances reach S3 through the NAT gateway and the bill is large. What do you do?

BeginnerScenarioVPC & Cloud Network Design
Answer

Situation read → NAT data processing charges apply to every GB, including traffic that never needs the internet.

What I'd do →

  1. Create an S3 gateway endpoint: aws ec2 create-vpc-endpoint --vpc-id vpc-0abc --service-name com.amazonaws.eu-west-1.s3 --route-table-ids rtb-0abc
  2. The endpoint adds a prefix-list route so S3 traffic bypasses NAT
  3. Do the same for DynamoDB (also a gateway endpoint)
  4. Confirm with Cost Explorer or flow logs that NAT bytes drop

Why → Gateway endpoints are free and keep the traffic on the AWS network.

Interview tip → Mention restricting the endpoint with an endpoint policy and bucket policy aws:SourceVpce.

All Networking questions Roadmap: Networking for DevOps

More on VPC & Cloud Network Design