Fatskills
Practice. Master. Repeat.
Study Guide: TECH **AWS S3 Storage Classes: Zero-Fluff, Hands-On Study Guide**
Source: https://www.fatskills.com/aws-certified-solutions-architect-associate/chapter/tech-aws-s3-storage-classes-zero-fluff-hands-on-study-guide

TECH **AWS S3 Storage Classes: Zero-Fluff, Hands-On Study Guide**

By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.

⏱️ ~7 min read

AWS S3 Storage Classes: Zero-Fluff, Hands-On Study Guide

(For AWS Solutions Architect – Associate)


1. What This Is & Why It Matters

You’re a cloud engineer at a mid-sized SaaS company. Your team just migrated a legacy on-prem backup system to AWS, and now your CFO is freaking out—S3 costs are 3x higher than expected. The problem? Your team dumped everything into S3 Standard, but 80% of the data is old logs, backups, and compliance archives that are rarely accessed.

S3 Storage Classes are your cost-saving superpower. They let you automatically move data to cheaper tiers based on access patterns—without changing your application code. Get this wrong, and you’ll either: - Overspend (paying for high-performance storage for data you never touch), or - Break compliance (accidentally deleting or making data inaccessible when it’s needed).

Real-world scenario:
You inherit a bucket with 50TB of data. Some files are accessed daily (user uploads), some monthly (audit logs), and some once a year (compliance archives). You need to optimize costs while keeping data available—without manually moving files.


2. Core Concepts & Components


? S3 Standard

  • Definition: Default storage class for frequently accessed data (millisecond latency, 99.99% availability).
  • Production insight: If you don’t set a lifecycle policy, you’re overpaying for data that’s rarely touched. Example: A bucket with 1TB of old logs costs $23/month in Standard vs. $1.25/month in Glacier Deep Archive.

? S3 Intelligent-Tiering

  • Definition: Automatically moves data between Frequent Access and Infrequent Access tiers based on usage (no retrieval fees).
  • Production insight: Best for unpredictable access patterns (e.g., user-generated content where some files go viral, others sit untouched). No retrieval fees make it safer than IA/Glacier for unknown workloads.

? S3 Standard-IA (Infrequent Access)

  • Definition: For data accessed less than once a month but needs millisecond retrieval (e.g., backups, disaster recovery).
  • Production insight: Cheaper than Standard (~50% cost savings) but has retrieval fees ($0.01/GB). Minimum storage duration: 30 days—deleting files early incurs a penalty.

? S3 One Zone-IA

  • Definition: Like Standard-IA, but stored in a single AZ (20% cheaper, but not resilient to AZ failures).
  • Production insight: Use for reproducible data (e.g., thumbnails, transcoded media) where losing an AZ isn’t catastrophic. Not for critical backups!

? S3 Glacier Instant Retrieval

  • Definition: For long-lived, rarely accessed data (e.g., compliance archives) with millisecond retrieval (unlike Glacier Flexible Retrieval).
  • Production insight: Cheaper than Standard-IA (~60% savings) but minimum 90-day storage duration. No retrieval fees—ideal for "store and forget" data.

? S3 Glacier Flexible Retrieval

  • Definition: For cold archives (e.g., financial records, medical data) with 3 retrieval options:
  • Expedited (1–5 mins, expensive)
  • Standard (3–5 hours)
  • Bulk (5–12 hours, cheapest)
  • Production insight: Cheapest storage (~90% savings vs. Standard) but retrieval takes hours. Minimum 90-day storage duration—deleting early incurs a penalty.

? S3 Glacier Deep Archive

  • Definition: Cheapest S3 storage (~95% savings vs. Standard) for data accessed once a year or less (e.g., regulatory archives).
  • Production insight: Retrieval takes 12+ hours. Minimum 180-day storage duration—deleting early is very expensive.

? S3 Lifecycle Policies

  • Definition: Rules to automatically transition or expire objects (e.g., move to Glacier after 30 days, delete after 7 years).
  • Production insight: Mandatory for cost control. Without lifecycle policies, you’re leaving money on the table (or violating compliance).


3. Step-by-Step Hands-On: Deploy a Cost-Optimized S3 Bucket


Prerequisites

  • AWS account with admin IAM permissions (or at least s3:* and iam:PassRole).
  • AWS CLI installed (aws --version to verify).
  • A test file (e.g., test.txt).


Step 1: Create a Bucket with Intelligent-Tiering (Default)

aws s3api create-bucket \
  --bucket my-cost-optimized-bucket-$(date +%s) \
  --region us-east-1 \
  --create-bucket-configuration LocationConstraint=us-east-1

Why? Intelligent-Tiering is the safest default for unknown access patterns.


Step 2: Upload a Test File to Standard Storage

echo "This is a test file" > test.txt
aws s3 cp test.txt s3://my-cost-optimized-bucket-123456789/

Verify:


aws s3 ls s3://my-cost-optimized-bucket-123456789/ --human-readable

Expected output:


2024-04-05 12:00:00       22 Bytes test.txt


Step 3: Apply a Lifecycle Policy (Move to Glacier After 30 Days)

Create lifecycle.json:


{
  "Rules": [
{
"ID": "MoveToGlacierAfter30Days",
"Status": "Enabled",
"Filter": {},
"Transitions": [
{
"Days": 30,
"StorageClass": "GLACIER"
}
]
} ] }

Apply the policy:


aws s3api put-bucket-lifecycle-configuration \
  --bucket my-cost-optimized-bucket-123456789 \
  --lifecycle-configuration file://lifecycle.json

Verify:


aws s3api get-bucket-lifecycle-configuration --bucket my-cost-optimized-bucket-123456789


Step 4: Manually Transition a File to Glacier (For Testing)

aws s3 cp s3://my-cost-optimized-bucket-123456789/test.txt s3://my-cost-optimized-bucket-123456789/test.txt \
  --storage-class GLACIER

Verify:


aws s3api head-object --bucket my-cost-optimized-bucket-123456789 --key test.txt

Expected output:


{
  "StorageClass": "GLACIER",
  "LastModified": "2024-04-05T12:00:00+00:00"
}


Step 5: Retrieve a Glacier File (Simulate a Restore)

aws s3api restore-object \
  --bucket my-cost-optimized-bucket-123456789 \
  --key test.txt \
  --restore-request '{"Days": 1, "GlacierJobParameters": {"Tier": "Standard"}}'

Check restore status:


aws s3api head-object --bucket my-cost-optimized-bucket-123456789 --key test.txt

Expected output (after ~3–5 hours):


{
  "Restore": "ongoing-request=\"false\", expiry-date=\"2024-04-06T00:00:00.000Z\"",
  "StorageClass": "GLACIER"
}

Download the restored file:


aws s3 cp s3://my-cost-optimized-bucket-123456789/test.txt ./restored_test.txt


4. ? Production-Ready Best Practices


? Security

  • Enable S3 Block Public Access (unless explicitly needed): bash aws s3api put-public-access-block \
    --bucket my-bucket \
    --public-access-block-configuration "BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true"
  • Use IAM policies, not bucket policies, for fine-grained access control.
  • Enable S3 Versioning to protect against accidental deletions: bash aws s3api put-bucket-versioning --bucket my-bucket --versioning-configuration Status=Enabled

? Cost Optimization

  • Use Intelligent-Tiering for unknown access patterns (avoids retrieval fees).
  • Set lifecycle policies on day 1—don’t wait for costs to spiral.
  • Monitor with S3 Storage Lens (free tier available): bash aws s3control get-storage-lens-configuration --config-id default
  • Avoid One Zone-IA for critical data (single AZ = higher risk).

?️ Reliability & Maintainability

  • Tag buckets for cost allocation: bash aws s3api put-bucket-tagging --bucket my-bucket --tagging 'TagSet=[{Key=Environment,Value=Production}]'
  • Use consistent naming (e.g., company-project-environment-data).
  • Test lifecycle policies in a non-production bucket first.

? Observability

  • Enable S3 Server Access Logging (for audit trails): bash aws s3api put-bucket-logging --bucket my-bucket --bucket-logging-status file://logging.json (Where logging.json specifies a target bucket.)
  • Set CloudWatch Alarms for unusual retrievals (e.g., sudden Glacier restores = potential breach).


5. ⚠️ Common Mistakes & Traps

Mistake Symptom Fix/Prevention
Using Standard for everything High S3 bill (e.g., $23/TB/month for old logs) Apply lifecycle policies to move data to IA/Glacier.
Deleting objects before minimum storage duration Unexpected charges (e.g., $0.03/GB for deleting Glacier files early) Set lifecycle policies to expire (not delete) after minimum duration.
Using One Zone-IA for backups Data loss if AZ fails Use Standard-IA or Glacier for backups.
Not testing Glacier restores Failed compliance audit (data "lost" because restores take hours) Test restore workflows before archiving critical data.
Ignoring retrieval fees Surprise bill from frequent IA/Glacier access Use Intelligent-Tiering for unpredictable access patterns.


6. ? Exam/Certification Focus


Typical Question Patterns

  1. "Which S3 class is best for backups accessed once a month?"
  2. Answer: S3 Standard-IA (millisecond retrieval, cheaper than Standard).
  3. Trap: Glacier Instant Retrieval is cheaper but has a 90-day minimum.

  4. "You need the cheapest storage for compliance archives accessed once a year."

  5. Answer: S3 Glacier Deep Archive.
  6. Trap: Glacier Flexible Retrieval is cheaper than Standard but not the cheapest.

  7. "Which S3 class automatically moves data between tiers?"

  8. Answer: S3 Intelligent-Tiering.
  9. Trap: Lifecycle policies manually move data—Intelligent-Tiering does it automatically.

  10. "What’s the minimum storage duration for S3 Standard-IA?"

  11. Answer: 30 days.
  12. Trap: Glacier is 90 days, Deep Archive is 180 days.

Key Distinctions

Feature Standard Intelligent-Tiering Standard-IA Glacier Instant Retrieval Glacier Flexible Retrieval Deep Archive
Retrieval Time Milliseconds Milliseconds Milliseconds Milliseconds 3–5 hours (Standard) 12+ hours
Retrieval Fees None None Yes None Yes Yes
Min Storage Duration None None 30 days 90 days 90 days 180 days
Use Case Active data Unpredictable access Monthly backups Rarely accessed archives Compliance archives Long-term archives


7. ? Hands-On Challenge

Challenge:
You have a bucket with 100GB of logs. Some logs are accessed daily (last 7 days), some monthly (last 30 days), and the rest are never touched. Design a lifecycle policy to minimize costs.

Solution:


{
  "Rules": [
{
"ID": "MoveRecentLogsToIA",
"Status": "Enabled",
"Filter": { "Prefix": "logs/" },
"Transitions": [
{
"Days": 7,
"StorageClass": "STANDARD_IA"
},
{
"Days": 30,
"StorageClass": "GLACIER"
}
],
"Expiration": {
"Days": 365
}
} ] }

Why it works:
- First 7 days: Standard (frequent access).
- Days 7–30: Standard-IA (cheaper, infrequent access).
- After 30 days: Glacier (cold storage).
- After 1 year: Expire (delete old logs).


8. ? Rapid-Reference Crib Sheet

Command/Concept Key Details
aws s3api create-bucket Default storage class: Standard.
aws s3 cp --storage-class Manually set storage class (e.g., --storage-class GLACIER).
Lifecycle Policy Transitions (move) + Expiration (delete).
Intelligent-Tiering No retrieval fees, auto-tiering.
Standard-IA 30-day min duration, retrieval fees.
Glacier Instant Retrieval 90-day min, millisecond retrieval.
Glacier Flexible Retrieval 3–5 hour retrieval, cheapest for cold data.
Deep Archive 180-day min, 12+ hour retrieval.
⚠️ Retrieval Fees Standard-IA, Glacier, Deep Archive charge per GB retrieved.
⚠️ Early Deletion Fees Deleting before min duration = prorated charge.


9. ? Where to Go Next

  1. AWS S3 Storage Classes Docs
  2. S3 Lifecycle Policy Examples
  3. S3 Storage Lens (Cost Monitoring)
  4. AWS Well-Architected Framework (Cost Optimization)

Final Tip:
Always test lifecycle policies in a non-production bucket first. A misconfigured policy can accidentally delete data or incur unexpected fees. Use the AWS CLI to verify changes before applying them to production.



ADVERTISEMENT