Skip to content

// diagrams › aws

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.

Static website architecture on AWS: visitors resolve the domain with a Route 53 alias, request pages over HTTPS from CloudFront with a WAF web ACL and ACM certificate, and CloudFront reads a private S3 bucket with origin access control; a build pipeline uploads files and invalidates paths.

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.

AWSStatic sites and CDNSecurity

Your diagram is one sentence away.

Start drawing, free

No account needed to start.