Explain AWS S3 storage classes and how VPC Gateway Endpoints cut NAT costs
Quick Summary: S3 offers tiered storage classes (Standard, Standard-IA, Intelligent-Tiering, Glacier) matching access frequency; pairing private subnets with a free S3 VPC Gateway Endpoint routes traffic over the AWS backbone and eliminates NAT Gateway per-GB charges.
Direct Interview Answer
Choosing the right S3 Storage Class balances storage GB/month cost against retrieval latency and fees: S3 Standard for active hot assets, Standard-IA / One Zone-IA for infrequent backups, Intelligent-Tiering for unpredictable patterns, and Glacier Instant/Flexible/Deep Archive for compliance retention.
Meanwhile, routing EC2-to-S3 traffic through a NAT Gateway incurs per-GB processing charges. Adding a VPC Gateway Endpoint modifies private subnet route tables so S3 traffic stays privately on the AWS backbone at zero hourly and zero per-GB endpoint cost.
Detailed Technical Explanation
S3 Lifecycle rules automate transitions cleanly (e.g., Standard → Standard-IA after 30 days → Glacier after 180 days), while S3 Block Public Access + Bucket Encryption (SSE-KMS/SSE-S3) protect data at rest.
Practical Walkthrough
Terraform configuration attaching a zero-cost S3 Gateway Endpoint to a private route table.
resource "aws_vpc_endpoint" "s3_gateway" {
vpc_id = aws_vpc.main.id
service_name = "com.amazonaws.ap-south-1.s3"
vpc_endpoint_type = "Gateway"
route_table_ids = [aws_route_table.private.id]
}
All private EC2/ECS S3 transfers bypass NAT Gateway charges cleanly.
Real-World Production Use Case
Data-heavy Indian FinTech and video analytics workloads transferring tens of terabytes monthly between private EKS/EC2 nodes and S3 data lakes.
Common Interview Mistakes to Avoid
- Migrating tiny < 128 KB objects to Standard-IA where minimum object billing sizes actually raise costs.
- Provisioning paid Interface Endpoints instead of free Gateway Endpoints for S3 and DynamoDB.