Post

S3 Ins & Outs

S3 Ins & Outs

What is S3?

S3 diagram
Amazon S3

Do you ever think that when you click a movie in Netflix , and in just two or three seconds the stream begins.The file behind that movie is enormous—gigabytes of HD or 4K video.So how does Netflix deliver it instantly?

Later, you start browsing Airbnb for a weekend trip. Images appear instantly: bedrooms, kitchens, city views from different hosts. But none of these images are stored on Airbnb servers.

Because the entire library of Netflix originals is stored inside Amazon S3. Every single picture you see was uploaded by a host and stored inside S3.

S3 diagram
Amazon S3 — Netflix & Airbnb

Amazon S3 is one of the main building blocks of AWS, and it is basically an infinitely scaling storage.

S3 Use Cases

  • Backup and Storage
  • Disaster Recovery
  • Archive
  • Hybrid Cloud Storage
  • Application Hosting
  • Media Hosting
  • Data Lakes and Big data Analytics
  • Software delivery

Examples: Nasdaq stores 7 years of data into S3 & Sysco runs analytics on its data and gain business insights!

Amazon S3 Bucket and S3 Objects

S3 diagram
Amazon S3 — buckets & objects (rounded, shadowed)

Buckets are like the directories and objects are like the files in the aws cloud.

For objects: Need a key(prefix + object_name)

Analogy: You are creating a folder and saving an image there. Same thing you will do in the cloud but for folder there is Buckets and for files there is Objects!

Amazon S3 Security

You will find many vulnerabilities related to S3 and everyone of them help due to misconfigurations

S3 diagram
Amazon S3 — Vulnerabilities

User-Based

IAM Policies — Define which API calls a specific IAM user, role, or group is allowed to perform. These policies are attached to IAM identities and control who can do what in AWS.

Resource-Based

  1. Bucket Policies — Bucket-level permissions written directly on the S3 bucket. Used to:
  • Allow or deny access to the bucket and its objects
  • Enable cross-account access
  • Control access from specific VPCs, IP ranges, services, etc.
  1. Object Access Control List (Object ACL) — More fine-grained, object-level permissions. Can specify which AWS accounts can read/write a single object. Can be disabled in most modern setups.

  2. Bucket Access Control List (Bucket ACL) — Legacy mechanism for granting other AWS accounts basic access to the bucket. Not commonly used and can also be disabled.

Access Logic (Very Important)

An IAM principal can access an S3 object only if:

  1. IAM permissions allow it OR the *resource policy (bucket policy / ACL) allows it.
  2. There is no explicit DENY anywhere (IAM or resource policy).

An explicit deny always overrides any allow.

Encryption

Encrypt objects stored in Amazon S3 using encryption keys — either SSE-S3, SSE-KMS, SSE-C, or Client-Side Encryption, depending on the use case.

S3 diagram
Amazon S3 — Encryption

Amazon S3 Storage Classes

Data in Amazon S3 can be transitioned between storage classes manually or through lifecycle rules. Objects may also be uploaded directly into any storage class.

Standard

FeatureDetails
Availability99.99%
RetrievalInstant
Retrieval CostNone (only storage cost applies)
PricingHighest among all classes
Suitable ForFrequently accessed data

Infrequent Access (IA)

Designed for data that is not accessed often yet still requires quick retrieval when needed. Transition from Standard to IA is only allowed after the object is 30 days old.

IA Classes

ClassAvailabilityNotes
Standard IA99.9%Lower storage cost than Standard; retrieval cost applies
One-Zone IA99.5%Stores data in a single AZ; data is lost if that AZ fails; suited for recreatable data

Glacier (Archival Storage)

Intended for long-term archival. Objects must be restored before use. Supports transitions from Standard at any time. Retrieval cost applies, and retrieval times vary by tier. Glacier offers default encryption at rest and in transit.

Glacier Storage Classes

Glacier Instant Retrieval

FeatureDetails
Availability99.9%
Retrieval TimeMilliseconds
Minimum Duration90 days
Use CaseData accessed once per quarter

Glacier Flexible Retrieval

FeatureDetails
Availability99.99%
Retrieval TiersExpedited (1–5 min), Standard (3–5 hrs), Bulk (5–12 hrs)
NotesExpedited may fail without provisioned capacity
Minimum Duration90 days

Glacier Deep Archive

FeatureDetails
Availability99.99%
Retrieval OptionsStandard (12 hrs), Bulk (48 hrs)
Minimum Duration180 days
NotesLowest storage cost among all S3 classes

Intelligent Tiering

FeatureDetails
Availability99.9%
BehaviorAutomatically moves objects between access tiers based on usage patterns
FeesSmall monthly monitoring and tiering fee
Retrieval ChargesNone

Moving between Storage Classes

S3 diagram
Amazon S3 — Storage Transition

AWS Storage Gateway

AWS Storage Gateway is a hybrid storage service that connects on-premises environments to AWS Cloud storage. It enables local applications to work with AWS services such as Amazon S3, EBS, and Glacier without changes to existing workflows. Typical use cases include disaster recovery, backup and restore, and tiered storage.

Gateway Types

File Gateway stores files as objects in S3, Volume Gateway integrates block storage with EBS, and Tape Gateway provides a virtual tape library that archives to S3 and Glacier. The exam does not require deep knowledge of these types.

S3 diagram
Amazon S3 — Storage Gateway
This post is licensed under CC BY 4.0 by the author.