Static website on S3 and CloudFront with origin access control
Host a static site on a private S3 bucket behind CloudFront with origin access control: the architecture, the bucket policy, the website-endpoint trap, and how to migrate from OAI.
Opens a copy in the editor, in a new tab, ready to change. No account needed.
What’s in this diagram
services and parts
- Visitors
- Build pipeline or developer
- Route 53 alias record
- AWS WAF web ACL
- CloudFront distribution (default root object: index.html)
- TLS certificate (ACM)
- Private bucket (REST endpoint, no public access)
- KMS key (if using SSE-KMS)
groups
- AWS Cloud
- Region
Key points
- Keep the bucket private and let only your CloudFront distribution read it, through origin access control.
- Use the bucket's normal REST endpoint as the origin. OAC does not work with the S3 website endpoint.
- Scope the bucket policy to your one distribution with the aws:SourceArn condition.
- Origin access identity (OAI) is the legacy way. Move to OAC; it can be done without downtime.
The whole story, step by step: Static website on S3 and CloudFront: secure it with OAC.


