S3
Overview
Amazon Simple Storage Service (S3) is AWS's infinitely scalable object storage service. You store objects (a file plus its metadata) in buckets, and each object is addressed by a unique key. There are no disks to size and no servers to manage: you pay for what you store and for the requests you make, and S3 is designed for 99.999999999% (11 nines) durability.
Think of a bucket as a giant, flat filing cabinet. The "folders" you see in the console are really just prefixes in the object key (for example invoices/2025/jan.pdf). S3 is used for static websites, backups, data lakes, media storage, application assets and log archives, and it is the most frequently tested service on the SAA-C03 exam.
What makes S3 powerful is its ecosystem: storage classes to save money as data cools, lifecycle rules to automate the moves, versioning and replication for protection, encryption and bucket policies for security, and event notifications that trigger Lambda, SQS or SNS when objects change.
Key Concepts
- S3 is regional object storage. Bucket names are globally unique; data is stored across at least 3 AZs (except One Zone classes).
- Objects can be 0 bytes to 5 TB. A single PUT is limited to 5 GB; use multipart upload above 100 MB (required above 5 GB).
- Strong read-after-write consistency for all PUTs, DELETEs and LIST operations (since December 2020), at no extra cost.
- Storage classes: Standard, Intelligent-Tiering, Standard-IA, One Zone-IA, Glacier Instant Retrieval, Glacier Flexible Retrieval, Glacier Deep Archive (plus Express One Zone).
- Lifecycle rules transition objects between classes and expire them automatically; Intelligent-Tiering moves data automatically with no retrieval fee.
- Versioning protects against overwrites and deletes; once enabled it can only be suspended, never disabled. Replication requires versioning.
- Encryption: all new objects are encrypted at rest by default with SSE-S3; alternatives are SSE-KMS, DSSE-KMS and SSE-C. Always encrypted in transit with HTTPS.
- Object Lock (WORM: governance, compliance, legal hold) and presigned URLs (time-limited access) cover compliance and secure sharing.
Detailed Notes
Storage classes
Pick the class by access pattern and retrieval time. All classes except One Zone and Express One Zone replicate across at least three AZs.
| Class | Use case | Min. duration | Retrieval |
|---|---|---|---|
| Standard | Frequently accessed data | None | Milliseconds |
| Intelligent-Tiering | Unknown or changing access | None | Milliseconds (opt-in archive tiers) |
| Standard-IA | Infrequent, but needs rapid access | 30 days | Milliseconds, retrieval fee |
| One Zone-IA | Re-creatable infrequent data | 30 days | Milliseconds, one AZ only |
| Glacier Instant Retrieval | Archive read once per quarter | 90 days | Milliseconds |
| Glacier Flexible Retrieval | Archive | 90 days | Expedited 1-5 min, Standard 3-5 h, Bulk 5-12 h |
| Glacier Deep Archive | Long-term compliance (7-10 years) | 180 days | Standard 12 h, Bulk 48 h |
Infrequent-access classes bill a 128 KB minimum object size. S3 Express One Zone (directory buckets) offers single-digit-millisecond latency for ML and analytics.
Lifecycle rules
Rules apply to a prefix, tag or whole bucket and define transition and expiration actions, including for noncurrent versions and incomplete multipart uploads.
{
"Rules": [{
"ID": "archive-logs",
"Status": "Enabled",
"Filter": { "Prefix": "logs/" },
"Transitions": [
{ "Days": 30, "StorageClass": "STANDARD_IA" },
{ "Days": 90, "StorageClass": "GLACIER" },
{ "Days": 365, "StorageClass": "DEEP_ARCHIVE" }
],
"Expiration": { "Days": 2555 },
"AbortIncompleteMultipartUpload": { "DaysAfterInitiation": 7 }
}]
}
Standard to Standard-IA or One Zone-IA requires the object to be at least 30 days old. Transitions only move down the waterfall.
Versioning and replication
- Versioning keeps every version; a DELETE adds a delete marker and the data remains. MFA Delete requires MFA to permanently delete versions or change versioning state.
- Cross-Region Replication (CRR) and Same-Region Replication (SRR) copy objects asynchronously to another bucket (even another account). Both buckets need versioning, S3 needs an IAM role, and only new objects replicate (use S3 Batch Replication for existing ones). Replication is not chained. Replication Time Control gives a 15-minute SLA.
Security
| Control | Purpose |
|---|---|
| Block Public Access | Account/bucket guardrail against accidental public exposure |
| Bucket policy | Resource-based JSON; cross-account access, enforce HTTPS or encryption |
| IAM policy | Identity-based access for users and roles |
| ACLs | Legacy; disabled by default via Object Ownership = bucket owner enforced |
| Access Points / VPC endpoint policy | Per-application access and network control |
{
"Version": "2012-10-17",
"Statement": [{
"Sid": "DenyInsecureTransport",
"Effect": "Deny",
"Principal": "*",
"Action": "s3:*",
"Resource": ["arn:aws:s3:::my-bucket", "arn:aws:s3:::my-bucket/*"],
"Condition": { "Bool": { "aws:SecureTransport": "false" } }
}]
}
Encryption options
| Option | Keys managed by | Notes |
|---|---|---|
| SSE-S3 | S3 (AES-256) | Default for all new objects |
| SSE-KMS | AWS KMS | Audit in CloudTrail; subject to KMS request quotas |
| DSSE-KMS | AWS KMS | Dual-layer encryption for strict compliance |
| SSE-C | You supply key per request | HTTPS required; AWS does not store the key |
| Client-side | You | Encrypt before upload |
Object Lock, presigned URLs and performance
- Object Lock requires versioning. Governance mode can be bypassed with special permission; Compliance mode cannot be shortened by anyone, even root. Legal hold has no expiry and is toggled independently. Glacier Vault Lock enforces a lockable policy on a vault.
- Presigned URLs grant temporary GET or PUT access using the signer's credentials, valid for up to 7 days with an IAM user (limited to the lifetime of temporary credentials for roles).
- Performance: 3,500 PUT/COPY/POST/DELETE and 5,500 GET/HEAD requests per second per prefix. Use Transfer Acceleration (CloudFront edge) for long-distance uploads and byte-range fetches for parallel downloads.
aws s3 presign s3://my-bucket/report.pdf --expires-in 3600
aws s3api put-bucket-versioning --bucket my-bucket \
--versioning-configuration Status=Enabled
Real World Example
Scenario — a media company stores 2 PB of raw video footage.
Editors need new footage instantly for 30 days, occasionally for a year, and legal requires seven-year retention that cannot be tampered with.
The team creates a versioned bucket with SSE-KMS and Block Public Access. A lifecycle rule moves objects to Standard-IA after 30 days, Glacier Flexible Retrieval after 180 days and Deep Archive after two years. An Object Lock compliance-mode retention of seven years satisfies auditors. Cross-Region Replication with Replication Time Control copies finished masters to a second Region for disaster recovery.
Freelance editors outside the company receive presigned URLs valid for 24 hours instead of IAM users. S3 event notifications trigger Lambda to generate thumbnails. Storage costs fall by roughly 70% compared with keeping everything in Standard, while compliance and DR requirements are met with no servers to operate.
Architecture Diagram
Objects cool through storage classes automatically while replication and events add resilience and automation.
- 1Users or applications upload objects directly or through time-limited presigned URLs; objects are encrypted at rest on arrival.
- 2A lifecycle rule moves aging objects from Standard to Standard-IA and then to Glacier without any application change.
- 3An ObjectCreated event triggers Lambda (or SQS) for post-processing such as thumbnails or virus scanning.
- 4Replication copies new versions asynchronously to a bucket in a second Region for disaster recovery.
Best Practices
- ✓Enable Block Public Access at the account level and serve public content through CloudFront with Origin Access Control instead of public buckets.
- ✓Enable versioning on important buckets and add lifecycle rules to expire noncurrent versions so storage costs do not grow unchecked.
- ✓Use Intelligent-Tiering when access patterns are unknown, and explicit lifecycle rules when the pattern is predictable.
- ✓Encrypt with SSE-KMS where you need key-level audit and control, and use S3 Bucket Keys to reduce KMS request costs.
- ✓Add a bucket policy that denies non-HTTPS requests (
aws:SecureTransport) and, where required, unencrypted uploads. - ✓Use multipart upload for large files and a lifecycle rule to abort incomplete multipart uploads after a few days.
- ✓Use S3 Access Points and IAM roles for application access; avoid long-lived IAM user keys and ACLs.
- ✓Turn on S3 Storage Lens, server access logs or CloudTrail data events for visibility into usage and access.
Common Interview Questions
Exam Tips
SAA-C03 focus
- Min storage durations: Standard-IA and One Zone-IA 30 days, Glacier IR and Flexible 90 days, Deep Archive 180 days. Moving objects sooner still incurs the charge.
- "Infrequent access but need milliseconds, and data can be re-created" -> One Zone-IA. "Unknown access pattern" -> Intelligent-Tiering.
- "Lowest cost long-term archive, retrieval within 12 hours is fine" -> Glacier Deep Archive. "Archive with millisecond retrieval" -> Glacier Instant Retrieval.
- Replication needs versioning on both buckets; it is asynchronous, not retroactive and not chained. SRR is used for log aggregation or prod/test copies.
- WORM / regulatory requirement -> Object Lock (Compliance mode); "admins with special permission may delete" -> Governance mode.
- SSE-C means the customer supplies the key on every request over HTTPS; SSE-KMS is the answer when the question mentions audit trails or key rotation control.
- Slow global uploads -> Transfer Acceleration; large file uploads -> multipart; faster parallel reads -> byte-range fetches; prefix limits are 3,500 / 5,500 per second.
- S3 is strongly consistent now - older answers about eventual consistency for overwrites are outdated. Temporary access without IAM users -> presigned URL.
Finished this lesson?
0 of 64 lessons done · 0% of the course

