homeexamplesstatic_website_aws

Static Website on AWS – S3 + CloudFront with Terraform

Published Oct 16, 2025
1 minutes read
Static website on AWS – architecture overview
CloudFront in front of a private S3 bucket; infrastructure managed by Terraform

This project is a production‑minded static website stack on AWS that focuses on security, reliability, and simplicity. The infrastructure is declared in Terraform and follows best practices: private S3 origin behind CloudFront, encryption at rest, and managed Terraform state with locking.

What This Project Does

Why I Built It

High‑Level Architecture

Static site UI
Minimal static site; CI/CD ready

Key Components

S3 Bucket (Origin)

CloudFront Distribution

Terraform State (Bootstrap)

How It Works (End‑to‑End)

  1. Terraform creates a private S3 bucket and uploads the site assets
  2. Provisions a CloudFront distribution + OAC
  3. Bucket policy restricts access to that distribution
  4. Users access the site via the CloudFront domain over HTTPS

Notable Defaults and Parameters

Frontend

A minimalist single‑page HTML highlights the stack and learning goals while keeping bundle size small.

Security Posture

How to Deploy (high level)

  1. Bootstrap remote backend (S3 + DynamoDB locks)
  2. Configure backend in the main stack; run terraform init/plan/apply
  3. Upload site assets to S3; integrate CI/CD as needed

What I’d Improve Next