Infra & Cloud terraform Intermediate

AWS S3 Static Website

Terraform module to provision an S3 bucket for static website hosting.

terraform
resource "aws_s3_bucket" "site" {
  bucket = var.bucket_name
}
resource "aws_s3_bucket_website_configuration" "site" {
  bucket = aws_s3_bucket.site.id
  index_document { suffix = "index.html" }
  error_document { key    = "404.html"   }
}

Prerequisites

  • terraform >= 1.0
  • AWS provider

Pro Tips

  • → Add CloudFront distribution for HTTPS.

Was this module useful?

Share your experience — it helps the team improve.

Leave Feedback

Commercial Licensing

Acquire a production access token or template license for enterprise deployment.

Module Info

Language
terraform
Level
Intermediate
Read time
4 min
Published
Sep 2026
License
Commercial License

Newsletter

New modules every week, directly to your inbox.