teluzia.Cloud Engineer · Day 40
CHAPTER 06 · AWS FOUNDATIONS

S3 storage and static hosting

4–5 hours including independent practice3 topics
LET’S MAKE THIS SIMPLE

What you’re learning today

Understand S3 as object storage and distinguish its API endpoint from a website endpoint. You will prepare a private-bucket object layout and a static site fixture locally. Public website access is a deliberate exposure decision; the lab evaluates that decision without disabling account or bucket protections. S3 stores objects inside buckets using keys. Slashes in a key support prefix organization but do not create ordinary filesystem directories. An object includes content and metadata, and bucket configuration governs access, versioning and other features. Bucket location and naming rules need deliberate selection before creation. Keep Block Public Access protections unless a reviewed public-content design specifically requires a different configuration. Public static hosting must expose only intended files, and account-level settings can override bucket-level intentions. A policy should distinguish reading website objects from listing the bucket or writing content. Never use private data in public fixtures.

Think of it this way

S3 is a labeled parcel warehouse: a key names each parcel, while a website endpoint is a public display counter with different behavior.

TOPIC 01 / 03Step by step

Buckets, objects and keys

S3 stores objects inside buckets using keys. Slashes in a key support prefix organization but do not create ordinary filesystem directories. An object includes content and metadata, and bucket configuration governs access, versioning and other features. Bucket location and naming rules need deliberate selection before creation. notes/day40.txt and site/index.html are object keys; listing prefix site/ selects matching keys, while a local directory named site is merely the source layout used before uploading those independent objects through the S3 API. Object semantics prevent applying filesystem assumptions blindly and clarify why changing an object means replacing or versioning its content rather than editing a remote block device or expecting directory permissions to control every key beneath a prefix automatically without policy configuration. Treating a slash prefix as a real protected directory overlooks object-policy scope; permissions apply through IAM and bucket policies, so define allowed key patterns explicitly instead of assuming local folder ownership transfers when files are uploaded to object storage in the cloud.

WORKED EXAMPLE
notes/day40.txt and site/index.html are object keys; listing prefix site/ selects matching keys, while a local directory named site is merely the source layout used before uploading those independent objects through the S3 API.
Why this matters

Object semantics prevent applying filesystem assumptions blindly and clarify why changing an object means replacing or versioning its content rather than editing a remote block device or expecting directory permissions to control every key beneath a prefix automatically without policy configuration.

A common trap

Treating a slash prefix as a real protected directory overlooks object-policy scope; permissions apply through IAM and bucket policies, so define allowed key patterns explicitly instead of assuming local folder ownership transfers when files are uploaded to object storage in the cloud.

Read all topics in this lesson

A complete reference to revisit alongside the guided steps above.

Buckets, objects and keys

S3 stores objects inside buckets using keys. Slashes in a key support prefix organization but do not create ordinary filesystem directories. An object includes content and metadata, and bucket configuration governs access, versioning and other features. Bucket location and naming rules need deliberate selection before creation. notes/day40.txt and site/index.html are object keys; listing prefix site/ selects matching keys, while a local directory named site is merely the source layout used before uploading those independent objects through the S3 API. Object semantics prevent applying filesystem assumptions blindly and clarify why changing an object means replacing or versioning its content rather than editing a remote block device or expecting directory permissions to control every key beneath a prefix automatically without policy configuration. Treating a slash prefix as a real protected directory overlooks object-policy scope; permissions apply through IAM and bucket policies, so define allowed key patterns explicitly instead of assuming local folder ownership transfers when files are uploaded to object storage in the cloud.

WORKED EXAMPLE
notes/day40.txt and site/index.html are object keys; listing prefix site/ selects matching keys, while a local directory named site is merely the source layout used before uploading those independent objects through the S3 API.

Why this matters

Object semantics prevent applying filesystem assumptions blindly and clarify why changing an object means replacing or versioning its content rather than editing a remote block device or expecting directory permissions to control every key beneath a prefix automatically without policy configuration.

A common trap

Treating a slash prefix as a real protected directory overlooks object-policy scope; permissions apply through IAM and bucket policies, so define allowed key patterns explicitly instead of assuming local folder ownership transfers when files are uploaded to object storage in the cloud.

Private access and public website exposure

Keep Block Public Access protections unless a reviewed public-content design specifically requires a different configuration. Public static hosting must expose only intended files, and account-level settings can override bucket-level intentions. A policy should distinguish reading website objects from listing the bucket or writing content. Never use private data in public fixtures. A site build containing index.html should not include .env, private keys or internal notes; a public read-only object policy, if chosen and reviewed, does not need to grant public PutObject or unrestricted account administration to anonymous website visitors. Public-content boundaries protect sensitive files and keep publishing separate from write authority, reducing the risk that a simple hosting exercise turns a bucket into publicly writable storage or exposes every unrelated artifact included in a copied project directory during deployment preparation. Disabling account-wide public-access protection just to make one site work affects more than the intended bucket; understand the complete access path and choose a controlled hosting design before changing shared security settings in any account that may hold other workloads or data.

WORKED EXAMPLE
A site build containing index.html should not include .env, private keys or internal notes; a public read-only object policy, if chosen and reviewed, does not need to grant public PutObject or unrestricted account administration to anonymous website visitors.

Why this matters

Public-content boundaries protect sensitive files and keep publishing separate from write authority, reducing the risk that a simple hosting exercise turns a bucket into publicly writable storage or exposes every unrelated artifact included in a copied project directory during deployment preparation.

A common trap

Disabling account-wide public-access protection just to make one site work affects more than the intended bucket; understand the complete access path and choose a controlled hosting design before changing shared security settings in any account that may hold other workloads or data.

Website endpoints and HTTPS

S3 website endpoints serve static website behavior such as an index document and error page, and do not provide HTTPS themselves. The S3 REST endpoint differs in behavior. HTTPS delivery can use a suitable hosting/CDN design; AWS recommends Amplify Hosting for managed static content delivery. A private S3 origin with CloudFront uses the REST-origin model rather than an S3 website endpoint for OAC. A design requiring HTTPS should not advertise an S3 website URL as TLS-protected; compare managed hosting with a CloudFront private REST-origin design and specify which endpoint handles index and error routing for the chosen application paths. Endpoint selection connects access control with browser behavior and prevents a site that works over local HTTP from being published under false assumptions about HTTPS, private origins or clean client-side routing when users request deep links directly from their browsers. Pointing a private-origin access control at an S3 website endpoint mixes incompatible models; choose the REST origin for that private-origin design or explicitly accept and secure the separate public website-origin pattern according to the intended hosting architecture and its limitations.

WORKED EXAMPLE
A design requiring HTTPS should not advertise an S3 website URL as TLS-protected; compare managed hosting with a CloudFront private REST-origin design and specify which endpoint handles index and error routing for the chosen application paths.

Why this matters

Endpoint selection connects access control with browser behavior and prevents a site that works over local HTTP from being published under false assumptions about HTTPS, private origins or clean client-side routing when users request deep links directly from their browsers.

A common trap

Pointing a private-origin access control at an S3 website endpoint mixes incompatible models; choose the REST origin for that private-origin design or explicitly accept and secure the separate public website-origin pattern according to the intended hosting architecture and its limitations.

KEEP THESE WITH YOU

Today’s takeaways

Use object and prefix semantics.

Review public-content exposure.

Select HTTPS delivery intentionally.

CLOSE THE LOOP

Ready to complete this day?

Verify the practical steps and pass the knowledge check (at least two thirds correct).

Lab steps verifiedKnowledge check passed