Reading20 min read·Module 4

VPC Endpoint Cost Savings

Key concepts

  • Gateway endpoints are free

  • Interface endpoint pricing

  • Data transfer savings

  • When to use endpoints

  • Cost-benefit analysis

Overview

VPC Endpoints provide a powerful mechanism for reducing data transfer costs while simultaneously improving security by keeping traffic on the AWS private network. Understanding endpoint pricing is critical for the SAA-C03 exam, as many questions focus on identifying the most cost-effective networking solution.

Core Concept

Gateway Endpoints for S3 and DynamoDB are completely FREE—no hourly charges, no data processing charges. Interface Endpoints cost approximately $0.01/hour per AZ plus $0.01/GB data processed. Both eliminate expensive NAT Gateway data processing fees ($0.045/GB), making endpoints one of the most impactful cost optimization strategies in AWS.

Exam Tip

When you see a scenario with high NAT Gateway costs and S3/DynamoDB traffic, the answer is almost always Gateway Endpoints. For other AWS services, compare Interface Endpoint costs (~$0.01/GB) vs NAT Gateway costs (~$0.045/GB) to determine the break-even point.

Key Concepts

Gateway Endpoint Pricing

Gateway Endpoint Pricing Model
Figure 1: Gateway Endpoints are completely free for S3 and DynamoDB

Gateway Endpoints: Zero Cost

Services Supported

  • Amazon S3
  • Amazon DynamoDB

Pricing Components | Component | Cost | |-----------|------| | Endpoint creation | FREE | | Hourly charge | FREE | | Data transfer | FREE | | Cross-AZ traffic | FREE |

Why It's Free:

  • No ENI created (uses route table entries)
  • No PrivateLink infrastructure
  • AWS encourages private connectivity to S3/DynamoDB

Impact: Eliminates 100% of NAT Gateway costs for S3/DynamoDB traffic

Interface Endpoint Pricing

Interface Endpoints: Pay-per-Use

Pricing Components (us-east-1 as reference) | Component | Cost | |-----------|------| | Per AZ per hour | ~$0.01/hour (~$7.30/month) | | Data processed | $0.01/GB | | Cross-AZ data | FREE (as of April 2022) |

AWS Services Supported: 100+ services including:

  • EC2, ECS, EKS, Lambda
  • Secrets Manager, Systems Manager
  • SQS, SNS, EventBridge
  • CloudWatch, KMS, STS
  • ECR, API Gateway, and more

Key Cost Factor: Per-AZ deployment

  • 1 AZ: ~$7.30/month base
  • 2 AZs: ~$14.60/month base
  • 3 AZs: ~$21.90/month base

NAT Gateway vs VPC Endpoints

NAT Gateway Costs

NAT Gateway Pricing | Component | Cost | |-----------|------| | Per NAT Gateway per hour | ~$0.045/hour (~$32.40/month) | | Data processing | $0.045/GB | | Cross-AZ data to NAT | $0.01/GB each way |

Example: 10 TB/month to S3

NAT Gateway:
  Hourly: 730 hours × $0.045 = $32.85
  Data: 10,000 GB × $0.045 = $450.00
  Total: $482.85/month

Gateway Endpoint:
  Total: $0.00/month

Savings: $482.85/month (100%)

Common Cost Trap: Many organizations unknowingly route S3/DynamoDB traffic through NAT Gateway when free alternatives exist.

Cost Comparison Analysis

Break-Even Analysis

When Interface Endpoints Save Money

Compare monthly costs for accessing an AWS service:

NAT Gateway: $32.40 (hourly) + ($0.045 × GB) Interface Endpoint: $7.30/AZ (hourly) + ($0.01 × GB)

Break-Even Calculation (Single AZ):

NAT = Interface
$32.40 + (0.045 × GB) = $7.30 + (0.01 × GB)
$25.10 = 0.035 × GB
GB = 717 GB

Decision Rule:

  • Under 717 GB/month → NAT Gateway cheaper
  • Over 717 GB/month → Interface Endpoint cheaper
  • Any volume S3/DynamoDB → Gateway Endpoint (FREE)

Multi-AZ Consideration:

  • 2 AZs: Break-even at ~360 GB
  • 3 AZs: Break-even at ~240 GB

Data Transfer Cost Elimination

Internet Egress Savings

Without VPC Endpoints Traffic path: EC2 → NAT Gateway → Internet Gateway → AWS Service

  • NAT processing: $0.045/GB
  • Internet egress may apply for some traffic patterns

With VPC Endpoints Traffic path: EC2 → VPC Endpoint → AWS Service (private network)

  • Gateway Endpoint: $0/GB
  • Interface Endpoint: $0.01/GB
  • No internet egress charges

Security Bonus: Traffic never leaves AWS network

Example Monthly Savings (100 TB to S3): | Method | Cost | |--------|------| | Via NAT Gateway | $4,532 | | Via Gateway Endpoint | $0 | | Monthly Savings | $4,532 |

Cost-Benefit Analysis

Complete Cost Comparison

Traffic TypeGateway EndpointInterface EndpointNAT GatewayRecommendation
S3 (any volume)$0~$7.30/AZ + $0.01/GB$32.40 + $0.045/GBGateway Endpoint (always)
DynamoDB (any volume)$0N/A$32.40 + $0.045/GBGateway Endpoint (always)
SQS/SNS (high volume)N/A~$7.30/AZ + $0.01/GB$32.40 + $0.045/GBInterface Endpoint
Secrets ManagerN/A~$7.30/AZ + $0.01/GB$32.40 + $0.045/GBInterface (security + cost)
Low volume API callsN/A~$7.30/AZ + $0.01/GB$32.40 + $0.045/GBNAT (under break-even)
ECR pulls (frequent)N/A~$21.90/month (3 endpoints)$32.40 + $0.045/GBInterface if >500GB

When to Use VPC Endpoints

Decision Framework

VPC Endpoint Decision Guide

ScenarioUse Gateway EndpointUse Interface EndpointUse NAT Gateway
S3 access from private subnetYes - FREEOnly if need on-prem accessNo - expensive
DynamoDB accessYes - FREEN/ANo - expensive
AWS service with high data volumeN/AYes - cheaper than NATNo
AWS service with low data volumeN/AMaybe - compare costsYes - simpler
Third-party SaaS via PrivateLinkN/AYes - only optionN/A
On-premises needs S3 accessNo - not routableYes - requiredN/A
Transit Gateway S3 routingNo - not supportedYes - requiredN/A
Internet access requiredN/AN/AYes - only option

Use Case Examples

SHCreate S3 Gateway Endpoint (FREE)
# Create Gateway Endpoint for S3 - NO COST
aws ec2 create-vpc-endpoint \
  --vpc-id vpc-1234567890abcdef0 \
  --service-name com.amazonaws.us-east-1.s3 \
  --route-table-ids rtb-1234567890abcdef0 rtb-0987654321fedcba0

# Verify endpoint creation
aws ec2 describe-vpc-endpoints \
  --filters Name=service-name,Values=com.amazonaws.us-east-1.s3 \
  --query 'VpcEndpoints[*].[VpcEndpointId,State]'
SHCreate DynamoDB Gateway Endpoint (FREE)
# Create Gateway Endpoint for DynamoDB - NO COST
aws ec2 create-vpc-endpoint \
  --vpc-id vpc-1234567890abcdef0 \
  --service-name com.amazonaws.us-east-1.dynamodb \
  --route-table-ids rtb-1234567890abcdef0

# Check all gateway endpoints
aws ec2 describe-vpc-endpoints \
  --filters Name=vpc-endpoint-type,Values=Gateway \
  --query 'VpcEndpoints[*].[ServiceName,State]'
SHCreate Interface Endpoint with Cost Awareness
# Create Interface Endpoint for Secrets Manager
# Cost: ~$7.30/month per AZ + $0.01/GB
aws ec2 create-vpc-endpoint \
  --vpc-id vpc-1234567890abcdef0 \
  --service-name com.amazonaws.us-east-1.secretsmanager \
  --vpc-endpoint-type Interface \
  --subnet-ids subnet-11111111 subnet-22222222 \
  --security-group-ids sg-1234567890abcdef0 \
  --private-dns-enabled

# Note: 2 subnets = 2 AZs = ~$14.60/month base cost
SHCalculate NAT Gateway Costs for Comparison
# Get NAT Gateway data transfer metrics
aws cloudwatch get-metric-statistics \
  --namespace AWS/NATGateway \
  --metric-name BytesOutToDestination \
  --dimensions Name=NatGatewayId,Value=nat-1234567890abcdef0 \
  --start-time 2024-01-01T00:00:00Z \
  --end-time 2024-01-31T23:59:59Z \
  --period 2592000 \
  --statistics Sum

# Calculate potential savings
# If BytesOut = 10,000,000,000,000 (10 TB)
# NAT Cost: 10,000 GB × $0.045 = $450
# Gateway Endpoint: $0
# Savings: $450/month

Real-World Cost Scenarios

Scenario 1: Data Lake Architecture

Setup: EC2 instances processing data from S3 data lake

  • Monthly S3 data transfer: 50 TB
  • Current: NAT Gateway

Cost Analysis:

Current (NAT Gateway):
  Hourly: $32.40/month
  Data: 50,000 GB × $0.045 = $2,250
  Total: $2,282.40/month

With Gateway Endpoint:
  Total: $0/month

Annual Savings: $27,388.80

Scenario 2: Microservices with SQS

Setup: 20 microservices using SQS heavily

  • Monthly SQS data: 5 TB
  • 3 AZs for HA

Cost Analysis:

Current (NAT Gateway):
  Hourly: $32.40/month
  Data: 5,000 GB × $0.045 = $225
  Total: $257.40/month

With Interface Endpoint (3 AZs):
  Hourly: $7.30 × 3 = $21.90/month
  Data: 5,000 GB × $0.01 = $50
  Total: $71.90/month

Monthly Savings: $185.50 (72%)

Scenario 3: Container Workload (ECR)

Setup: EKS cluster pulling images from ECR

  • Monthly ECR pulls: 2 TB
  • Requires 3 endpoints: ecr.api, ecr.dkr, logs

Cost Analysis:

Current (NAT Gateway):
  Hourly: $32.40/month
  Data: 2,000 GB × $0.045 = $90
  Total: $122.40/month

With Interface Endpoints (3 endpoints × 2 AZs):
  Hourly: $7.30 × 3 × 2 = $43.80/month
  Data: 2,000 GB × $0.01 = $20
  Total: $63.80/month

Monthly Savings: $58.60 (48%)

Common Pitfalls

Paying for S3 Access via NAT Gateway

The Mistake: Routing S3 traffic through NAT Gateway instead of using free Gateway Endpoint.

The Cost: NAT Gateway charges $0.045/GB for S3 data that could transfer for FREE via Gateway Endpoint.

Example Impact: 10 TB/month to S3 via NAT = $450/month wasted.

The Fix: Always create S3 and DynamoDB Gateway Endpoints in every VPC. There is no reason not to—they are free and provide better security.

Creating Interface Endpoint for S3 When Gateway Works

The Mistake: Using S3 Interface Endpoint (~$7.30/AZ/month + $0.01/GB) when Gateway Endpoint (FREE) would suffice.

When Interface IS Needed:

  • On-premises access to S3 via Direct Connect/VPN
  • Transit Gateway routing to S3
  • Cross-region access via peering

The Fix: Default to Gateway Endpoint for S3. Only use Interface Endpoint when the specific use case requires it.

Deploying Interface Endpoints in All AZs Unnecessarily

The Mistake: Creating Interface Endpoints in 3+ AZs when workloads only run in 1-2 AZs.

The Cost: $7.30/month per unnecessary AZ deployment.

Example: 5 services × 3 AZs = 15 endpoint-AZ combinations = $109.50/month. If only 2 AZs needed: $73/month wasted.

The Fix: Deploy Interface Endpoints only in AZs where workloads actually run. Consider HA requirements but don't over-provision.

Forgetting to Associate Route Tables with Gateway Endpoints

The Mistake: Creating Gateway Endpoint but not associating it with all relevant route tables.

The Impact: Traffic continues flowing through NAT Gateway, incurring unnecessary costs.

The Fix: After creating Gateway Endpoint, verify association with ALL private subnet route tables. Check route tables for new subnets added later.

# Verify route table associations
aws ec2 describe-vpc-endpoints \
  --vpc-endpoint-ids vpce-xxx \
  --query 'VpcEndpoints[*].RouteTableIds'
Not Monitoring Endpoint Data Processing Costs

The Mistake: Creating Interface Endpoints without monitoring actual data transfer volumes.

The Risk: Low-volume services may cost more via Interface Endpoint than NAT Gateway.

Break-Even Point: ~717 GB/month for single AZ, ~240 GB for 3 AZs.

The Fix: Use Cost Explorer to monitor VPC Endpoint costs. Set up billing alarms for unexpected increases. Regularly review if endpoints are still cost-effective.

Exam Scenarios

Scenario-Based Questions

ScenarioBest SolutionCost Rationale
EC2 in private subnet needs S3 access, 100 TB/month data transferS3 Gateway EndpointFREE vs $4,500+ via NAT
Lambda in VPC calling DynamoDB frequentlyDynamoDB Gateway EndpointFREE, no Lambda VPC cold start penalty
On-premises servers need private S3 access via Direct ConnectS3 Interface EndpointGateway not accessible from on-prem
Application calling Secrets Manager 10 times/dayEvaluate: NAT may be cheaperLow volume doesn't justify endpoint hourly cost
ECS tasks pulling 5 TB/month from ECRECR Interface Endpoints$63.80 vs $257 via NAT
Batch job processing 500 GB S3 data monthlyS3 Gateway EndpointFREE regardless of volume
Transit Gateway needs to route to S3S3 Interface EndpointGateway doesn't support Transit Gateway
Private API for third-party SaaS integrationInterface Endpoint (PrivateLink)Only option for private SaaS connectivity

Cost Optimization Question Patterns

  1. "High NAT Gateway costs" + "S3/DynamoDB traffic" = Gateway Endpoint
  2. "Reduce costs" + "AWS service access" + "high volume" = Interface Endpoint
  3. "Most cost-effective" + "S3 from private subnet" = Gateway Endpoint (free)
  4. "On-premises" + "private S3 access" = Interface Endpoint (required)
  5. "Transit Gateway" + "S3" = Interface Endpoint (Gateway not supported)

Test Your Knowledge

Q

A company has EC2 instances in private subnets that transfer 20 TB of data to S3 monthly. They currently use a NAT Gateway and want to reduce costs. What is the MOST cost-effective solution?

AReplace NAT Gateway with a NAT instance
BCreate an S3 Interface Endpoint
CCreate an S3 Gateway Endpoint
DUse S3 Transfer Acceleration
Q

An architect is designing a VPC with private subnets. The application needs to access S3, DynamoDB, and Secrets Manager. What is the MOST cost-effective endpoint configuration?

AOne Interface Endpoint for all three services
BGateway Endpoints for all three services
CGateway Endpoints for S3 and DynamoDB, Interface Endpoint for Secrets Manager
DNAT Gateway for all traffic
Q

A company processes 500 GB of data monthly through an Interface Endpoint across 2 AZs. Their monthly endpoint cost is approximately $19.60. They want to reduce this cost. What should they evaluate?

ASwitch to a Gateway Endpoint for the same service
BUse NAT Gateway instead—it may be cheaper for this volume
CDeploy the endpoint in more AZs for better pricing
DEnable PrivateLink cross-region for discounts
Q

A Solutions Architect needs to provide on-premises servers with private access to Amazon S3 via AWS Direct Connect. Which endpoint type must be used?

AS3 Gateway Endpoint
BS3 Interface Endpoint
CEither Gateway or Interface Endpoint
DNAT Gateway in the VPC

Quick Reference

Endpoint Pricing Summary

Endpoint TypeHourly CostData CostSupported Services
GatewayFREEFREES3, DynamoDB only
Interface~$0.01/hour/AZ$0.01/GB100+ AWS services
NAT Gateway~$0.045/hour$0.045/GBAny internet access

Cost Formulas

Gateway Endpoint Monthly Cost:
  $0 (always free)

Interface Endpoint Monthly Cost:
  (Number of AZs × 730 hours × $0.01) + (GB processed × $0.01)
  Example: 2 AZs, 1 TB = (2 × 730 × $0.01) + (1000 × $0.01) = $24.60

NAT Gateway Monthly Cost:
  (730 hours × $0.045) + (GB processed × $0.045)
  Example: 1 TB = (730 × $0.045) + (1000 × $0.045) = $77.85

Interface vs NAT Break-Even (per AZ):
  GB = ($32.40 - $7.30) ÷ ($0.045 - $0.01) = 717 GB

CLI Quick Reference

# List all VPC endpoints with costs awareness
aws ec2 describe-vpc-endpoints \
  --query 'VpcEndpoints[*].[VpcEndpointId,VpcEndpointType,ServiceName,State]' \
  --output table

# Create S3 Gateway Endpoint (FREE)
aws ec2 create-vpc-endpoint \
  --vpc-id vpc-xxx \
  --service-name com.amazonaws.REGION.s3 \
  --route-table-ids rtb-xxx

# Create DynamoDB Gateway Endpoint (FREE)
aws ec2 create-vpc-endpoint \
  --vpc-id vpc-xxx \
  --service-name com.amazonaws.REGION.dynamodb \
  --route-table-ids rtb-xxx

# Create Interface Endpoint (costs apply)
aws ec2 create-vpc-endpoint \
  --vpc-id vpc-xxx \
  --service-name com.amazonaws.REGION.SERVICE \
  --vpc-endpoint-type Interface \
  --subnet-ids subnet-xxx \
  --security-group-ids sg-xxx

# Check NAT Gateway data transfer for cost analysis
aws cloudwatch get-metric-statistics \
  --namespace AWS/NATGateway \
  --metric-name BytesOutToDestination \
  --dimensions Name=NatGatewayId,Value=nat-xxx \
  --start-time START_TIME --end-time END_TIME \
  --period 2592000 --statistics Sum

Decision Quick Guide

QuestionAnswer
Need S3 access from VPC?Gateway Endpoint (FREE)
Need DynamoDB access from VPC?Gateway Endpoint (FREE)
Need AWS service access, >717 GB/month?Interface Endpoint (cheaper than NAT)
Need AWS service access, <717 GB/month?Compare costs (NAT may be cheaper)
Need S3 from on-premises?Interface Endpoint (required)
Need S3 via Transit Gateway?Interface Endpoint (required)
Need internet access?NAT Gateway (only option)

Further Reading

Related services

VPC