Module 3 of 6 • Private Connectivity to AWS Services

VPC Endpoints: Gateway Endpoints vs. Interface Endpoints (PrivateLink)

Why pay NAT Gateway fees and send traffic toward the public internet just to talk to Amazon S3, DynamoDB, or Secrets Manager in the same region? Switch between the three connectivity modes below to see how Gateway Endpoints and Interface Endpoints (PrivateLink) keep traffic 100% private.

🚇
The Everyday Mental Model: Imagine your office building (VPC) is next door to the AWS Bank Vault (S3 / KMS). Without an Endpoint, your courier has to walk out the front door onto the public street (through NAT + IGW) to enter the bank. A Gateway Endpoint (for S3 & DynamoDB) adds a free private hallway door on your building map (Route Table). An Interface Endpoint (PrivateLink) installs a dedicated bank teller window (an ENI with its own private IP) right inside your locked back office!
Next: Module 4 (Security Groups & NACLs) → ← Prev: Module 2 (ENIs & NAT)
Mode 2: Gateway VPC Endpoint (Route Table Prefix List)
🏢 VPC (10.0.0.0/16) — Corporate Workload Account 🌤️ Public Subnet (10.0.1.0/24) 🛎️ NAT Gateway 💸 $0.045 / GB Fee EIP: 52.88.10.99 🚪 IGW (igw-01) Public Internet Exit Gate 🔒 Private Subnet (10.0.2.0/24) — No Direct Internet Access 🖥️ Private App EC2 ENI Priv IP: 10.0.2.50 DNS resolves s3.amazonaws.com → 52.217.10.8 (Public S3 IP) 📋 Private Subnet Route Table 10.0.0.0/16 → local 0.0.0.0/0 → nat-01 pl-63a5400a (S3 IPs) → vpce-gw-s3 🪪 Interface Endpoint ENI (PrivateLink) Private IP: 10.0.2.88 (Inside Subnet!) 🛡️ SG: Allow 443 from 10.0.2.0/24 For: Secrets Manager, KMS, SQS, Bedrock Private DNS: *.amazonaws.com → 10.0.2.88 🚪 Gateway Endpoint vpce-gw-s3 (FREE!) Route Table Prefix Target Only for S3 & DynamoDB ☁️ AWS Service Network Same Region (us-east-1) ✅ Corporate AWS Service 🪣 s3://acme-prod-data ResourceOrgID: o-acme-corp Bucket Policy: Require aws:SourceVpce = vpce-* 🕵️ External Account Bucket 🪣 s3://evil-exfil-drop ResourceOrgID: o-stranger99 Used if malware on EC2 tries to copy data to external S3
Gateway Endpoint = Route Table entry (S3/DynamoDB only, $0) Interface Endpoint = ENI with Private IP inside subnet (PrivateLink)