4.2 Storage Cost Optimization — S3 Tiers, EBS, and Data Transfer
Key Takeaways
- S3 lifecycle policies automatically transition objects to cheaper storage classes based on age, reducing storage costs by up to 95%.
- S3 Intelligent-Tiering eliminates the need to manually manage storage class transitions when access patterns are unpredictable.
- EBS cost optimization includes choosing the right volume type (gp3 is 20% cheaper than gp2), deleting unused volumes, and using snapshots for infrequent access.
- Data transfer within the same AZ is free; cross-AZ is \$0.01/GB; internet egress starts at \$0.09/GB — use VPC endpoints and CloudFront to reduce transfer costs.
- AWS Storage Gateway and S3 File Gateway extend on-premises storage to the cloud, enabling cost-effective hybrid storage architectures.
Storage Cost Optimization — S3 Tiers, EBS, and Data Transfer
Quick Answer: Use S3 lifecycle policies to automatically move data to cheaper tiers. Choose gp3 over gp2 (20% cheaper). Delete unused EBS volumes and snapshots. Use VPC endpoints (free for S3 Gateway) and CloudFront to reduce data transfer costs. S3 Intelligent-Tiering for unpredictable access patterns.
S3 Storage Cost Comparison
| Storage Class | Cost per GB/Month (us-east-1) | Best For |
|---|---|---|
| S3 Standard | $0.023 | Frequently accessed data |
| S3 Intelligent-Tiering | $0.023 (frequent) - $0.004 (archive) | Unknown/changing access patterns |
| S3 Standard-IA | $0.0125 | Infrequent access, rapid retrieval |
| S3 One Zone-IA | $0.01 | Reproducible infrequent data |
| S3 Glacier Instant Retrieval | $0.004 | Archive with millisecond retrieval |
| S3 Glacier Flexible Retrieval | $0.0036 | Archive, 1-12 hour retrieval |
| S3 Glacier Deep Archive | $0.00099 | Long-term archive, 12-48 hour retrieval |
Savings: Moving from Standard to Glacier Deep Archive saves 95.7% on storage costs.
S3 Cost Optimization Strategies
1. Lifecycle Policies
| Strategy | Configuration |
|---|---|
| Transition old versions | Move noncurrent versions to Standard-IA after 30 days, Glacier after 90 days |
| Expire old versions | Delete noncurrent versions after 365 days |
| Delete incomplete uploads | Abort multipart uploads after 7 days |
| Transition infrequent data | Move objects to Standard-IA after 30 days if access declines |
2. S3 Analytics
S3 Analytics provides recommendations for when to transition objects between storage classes based on actual access patterns. Enable it on a bucket and review recommendations after 30 days.
3. S3 Inventory
Generate reports of all objects in a bucket with metadata (size, storage class, encryption status) to identify optimization opportunities.
4. Requester Pays
For shared datasets, enable Requester Pays so the person downloading the data pays the data transfer charges instead of the bucket owner.
EBS Cost Optimization
| Strategy | Savings |
|---|---|
| Switch gp2 to gp3 | 20% cheaper (gp3 has independent IOPS and throughput) |
| Delete unused volumes | 100% savings on orphaned volumes |
| Delete old snapshots | Remove snapshots no longer needed for backups |
| Use EBS lifecycle policies | Automate snapshot creation and cleanup |
| Right-size volumes | Reduce volume size if less than 50% used |
| Use st1/sc1 for sequential workloads | 75% cheaper than SSD for throughput-oriented workloads |
Data Transfer Costs
| Transfer Type | Cost |
|---|---|
| Into AWS (ingress) | Free |
| Same AZ | Free (same AZ, using private IP) |
| Cross-AZ (same Region) | $0.01/GB each way |
| Cross-Region | $0.02/GB |
| Internet egress | $0.09/GB (first 10 TB/month, then decreasing) |
| Via CloudFront | $0.085/GB (cheaper than direct internet egress) |
| Via VPC Gateway Endpoint (S3, DynamoDB) | Free |
Data Transfer Optimization
| Strategy | How It Saves |
|---|---|
| VPC Gateway Endpoints | Free S3/DynamoDB access (vs. NAT Gateway at $0.045/GB) |
| CloudFront | Cheaper egress + caching reduces origin requests |
| S3 Transfer Acceleration | Faster but more expensive — only use for long-distance uploads |
| Same-AZ deployments | Free cross-instance traffic (but reduces availability) |
| AWS Direct Connect | Reduced data transfer rates for high-volume connections |
| Compress data | Reduce bytes transferred |
On the Exam: "Reduce data transfer costs from EC2 to S3" → VPC Gateway Endpoint (free). "Reduce NAT Gateway costs" → VPC endpoints bypass NAT for AWS service traffic.
AWS Storage Gateway
Storage Gateway provides hybrid cloud storage, connecting on-premises environments to AWS storage.
| Type | Description | Backend | Use Case |
|---|---|---|---|
| S3 File Gateway | NFS/SMB file access to S3 | S3 | File shares, backups, data lake ingestion |
| FSx File Gateway | Low-latency SMB access to FSx for Windows | FSx | Windows file shares with local cache |
| Volume Gateway | iSCSI block storage backed by S3/EBS snapshots | S3 + EBS | Block storage, disaster recovery |
| Tape Gateway | Virtual tape library backed by S3/Glacier | S3 Glacier | Backup (replaces physical tape) |
A company has EC2 instances accessing S3 through a NAT Gateway, resulting in significant data transfer charges. How can they eliminate these NAT Gateway processing costs for S3 traffic?
A company stores 100 TB of data in S3 Standard. The data is accessed frequently for the first 30 days, rarely for the next 11 months, and must be retained for 7 years. Which approach minimizes storage costs?
Which data transfer is FREE in AWS?