Skip to content
intermediate Phase 4 · Storage Services

S3 Object Storage

Create and manage S3 buckets, configure storage classes, versioning, lifecycle rules, and cross-region replication for durable object storage.

1h
0 problems
Topic Progress 0%

Bucket Configuration and Versioning

An S3 bucket is a container for objects (files). Bucket names must be globally unique across all AWS accounts, lowercase, 3-63 characters, no periods in us-east-1. Each bucket belongs to one AWS account in one region.

Versioning preserves, retrieves, and restores every version of every object. Enable versioning to protect against accidental deletions (DELETE puts a delete marker) and overwrites. Versioning is required for cross-region replication. Once enabled, versioning can only be suspended, not removed.

Bucket policies use resource-based JSON to grant cross-account access or enforce encryption. Example: require all uploads use server-side encryption. Bucket ACLs provide simpler access control but are less recommended—use bucket policies or IAM instead. Access Points simplify access management for shared datasets—create named endpoints with different policies for different applications.

Storage Classes

S3 offers six storage classes optimized for different access patterns:

S3 Standard for frequently accessed data—99.999999999% durability, low latency, no retrieval fees. S3 Standard-IA (Infrequent Access) for data accessed monthly—30% cheaper storage but retrieval charges apply. S3 One Zone-IA for non-critical, re-creatable data at 50% less cost.

S3 Glacier Instant Retrieval for data accessed quarterly—millisecond retrieval, lowest archive cost. S3 Glacier Flexible Retrieval for archives accessed 1-2 times yearly—free bulk retrieval in 12 hours, expedited in 1-5 minutes. S3 Glacier Deep Archive for long-term retention (7-10 years)—cheapest option, 12-48 hour retrieval.

S3 Intelligent-Tiering automatically moves objects between tiers based on access patterns—no retrieval fees, small monitoring fee per object. Ideal for unknown or changing access patterns. Choose based on retrieval time tolerance and data access frequency.

Replication and Event Notifications

Cross-Region Replication (CRR) copies objects to a bucket in another region for compliance, latency reduction, or disaster recovery. Enable versioning on both source and destination. Replication Time Control (RTC) guarantees 15-minute replication for 99.99% of objects.

Same-Region Replication (SRR) copies objects within the same region—useful for log aggregation, dev/test from production, and customer-facing data sovereignty requirements.

S3 Event Notifications trigger Lambda functions, SNS topics, or SQS queues on object events: s3:ObjectCreated:*, s3:ObjectRemoved:*. Filter by prefix (folder) or suffix (file type). Use S3 Event Notifications with EventBridge for more complex routing and filtering patterns.

Replication metrics in CloudWatch track replication lag and bytes pending. Monitor to ensure SLAs are met. Replication rules can be configured to replicate entire bucket or specific prefixes.

Security, Encryption, and Pre-signed URLs

Server-Side Encryption (SSE) protects data at rest: SSE-S3 (S3 manages keys), SSE-KMS (AWS KMS manages keys with audit trail), SSE-C (you provide keys). Default encryption applies to all new objects.

Block Public Access settings prevent accidental public exposure—enable at account and bucket level. Use VPC Endpoints to access S3 without internet gateway. Bucket policies can enforce aws:SecureTransport (HTTPS-only) and s3:signatureversion (SigV4).

Pre-signed URLs provide temporary access to private objects—generate with SDK, valid for specified duration (default 15 min). Use for file uploads/downloads without exposing bucket publicly. Pre-signed URLs use your IAM credentials for authorization.

Access Points simplify managing access to shared datasets—create named endpoints with custom policies. Useful for restricting access to specific VPCs or applications. S3 Access Grants integrate with corporate identity providers for fine-grained access.

Quiz

1. What is the durability of S3 Standard storage?

Question 1 options

2. Which storage class is best for data accessed quarterly with millisecond retrieval?

Question 2 options

3. What happens when you delete an object in a versioned S3 bucket?

Question 3 options

Flashcards

Question

What is S3 versioning?

Answer

A feature that preserves, retrieves, and restores every version of every object in a bucket, protecting against accidental deletions.

Question

What is the difference between CRR and SRR?

Answer

CRR (Cross-Region) replicates across regions for compliance/DR. SRR (Same-Region) replicates within a region for log aggregation/dev/test.

Question

What are pre-signed URLs?

Answer

Time-limited URLs granting temporary access to private S3 objects without exposing the bucket publicly.

Question

What is S3 Intelligent-Tiering?

Answer

A storage class that automatically moves objects between access tiers based on usage patterns, with no retrieval fees.

Revision Notes

Key Takeaways

  • 1. Versioning preserves all object versions—required for CRR, use delete markers for safe deletion
  • 2. Choose storage class by access pattern: Standard (frequent), IA (monthly), Glacier (archive)
  • 3. CRR for cross-region DR/compliance; SRR for same-region log aggregation
  • 4. Enable Block Public Access, use SSE-KMS, and pre-signed URLs for secure access

Interview Tips

  • Explain S3 durability (11 nines) and availability (99.99%) guarantees
  • Know the difference between SSE-S3, SSE-KMS, and SSE-C encryption
  • Describe when to use pre-signed URLs vs. bucket policies vs. CloudFront
  • Discuss replication metrics and RTC for meeting RPO requirements

Cheat Sheet

S3: object storage. Bucket = container (globally unique name). Versioning: preserves all versions, delete markers. Classes: Standard (frequent), Standard-IA (monthly, retrieval fee), One Zone-IA (cheap, single AZ), Glacier Instant (quarterly, ms), Glacier Flexible (archive, hours), Deep Archive (long-term, 12-48h), Intelligent-Tiering (auto). Replication: CRR (cross-region), SRR (same-region). Security: SSE-S3/KMS/C, Block Public Access, pre-signed URLs.