Private static hosting and ECS Express Mode
Private origin, public website
A public website need not have a public S3 bucket. Use a regular S3 bucket origin with CloudFront origin access control (OAC), a scoped bucket policy allowing the intended distribution, and Block Public Access. CloudFront can serve public files over HTTPS while direct anonymous S3 reads are denied. OAC protects access to the origin, not access by viewers; private viewer content needs additional authorization. An S3 website endpoint is a custom origin and does not support OAC; do not confuse it with the regular S3 origin.
Build the smallest site offline
Save the following as index.html in a disposable local folder and open it in your browser. The expected result is a heading and one paragraph. No account, upload, external scripts or network connection is needed. A real release would publish the file through Amplify or through a private S3 origin with CloudFront. Configure a default root object for the latter and use versioned asset names to manage caching.
<!doctype html><html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Bookshop</title> </head> <body> <main> <h1>Bookshop</h1> <p>Browse our public catalog.</p> </main> </body></html>ECS Express Mode for a container backend
For a dynamic HTTP application already packaged as a container, ECS Express Mode can coordinate a Fargate service, load balancer, networking, scaling and monitoring. It requires an image and appropriate execution and infrastructure roles; an application needing AWS APIs also needs suitable task permissions. Review the network settings: the documented default setup can create an internet-facing load balancer. Restrict access intentionally, set scaling bounds and test health. Express Mode has no separate service fee, but its underlying resources are billable.
App Runner migration is a separate case
As documented on 2026-11-27, App Runner is closed to new customers (since April 30, 2026). Existing customers can plan migration to ECS Express Mode. Source-only deployments need a container build and registry step. In a fictional migration, inventory image, port, secrets references, roles, health endpoints, networking and domain; test the replacement before changing traffic. If you control a shared custom hostname, weighted DNS can gradually shift traffic; cached DNS means the weights are not exact request percentages or instant rollback. With only a service-generated hostname, update clients or controlled DNS to the new endpoint instead.
Verify and roll back
Define acceptance before release: HTTPS and health checks pass, authorized requests work, anonymous private data requests fail, latency and error rates remain within agreed bounds, and cost remains within a reviewed estimate. Preserve the old working release during the observation period. If checks fail, stop the shift and restore the old route; allow for cached DNS and confirm recovery. Check database migration compatibility separately. Remove only reviewed, lab-owned unused resources after approval, including load balancers, storage, logs and DNS records.
Practice
Choose private S3/CloudFront for the public menu and an authenticated API or container service for dynamic orders. In the offline migration fixture, reject a replacement with failed health checks. Explain why a bucket being private does not mean the website itself is private. No real deployment is required.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Private static hosting and ECS Express Mode — knowledge check
Apply hosting choices to fictional workloads.
Which origin supports CloudFront OAC for a private general-purpose S3 bucket?
A public CloudFront distribution has OAC. What does OAC alone protect?
A new AWS customer wants an App Runner-like container deployment. Which should they evaluate?
The replacement fails health checks during migration. What next?
Which Express Mode cost statement is accurate?