Hosting a Static DevOps Resources Website on AWS with Terraform: A Complete Guide

Introduction

In today's fast-paced DevOps landscape, having a centralized hub for essential tools and resources can be invaluable. Whether you're onboarding new team members, sharing best practices, or simply maintaining a quick reference guide for cloud and DevOps tools, a well-organized static website can be the perfect solution.

In this post, I'll walk you through how to create and deploy a beautiful, responsive static website that showcases DevOps tools and cloud platforms using Terraform, AWS S3, and CloudFront. This approach is cost-effective, scalable, and follows infrastructure-as-code best practices.

Why Static Hosting with Terraform?

Cost-Effective: Static hosting on S3 is incredibly cheap—pennies per month for most use cases.

Zero Maintenance: No servers to manage, no databases to maintain, no security patches to apply.

Scalability: S3 and CloudFront automatically handle traffic spikes without any intervention.

Infrastructure as Code: Using Terraform makes your infrastructure reproducible, versionable, and auditable.

CDN Performance: CloudFront ensures your content is delivered quickly to users worldwide.

Security: With Origin Access Identity (OAI), your S3 bucket is never exposed to the internet directly.

Architecture Overview

┌─────────────────┐
│  CloudFront     │ (Global CDN, HTTPS)
│  Distribution   │
└────────┬────────┘
         │
┌────────▼────────┐
│   S3 Bucket     │ (Stores index.html)
│  eu-central-1   │
└─────────────────┘

Key Components:

  • S3 Bucket – Stores the static HTML files
  • CloudFront Distribution – Global CDN that caches and distributes content
  • Origin Access Identity (OAI) – Securely grants CloudFront access to S3
  • IAM Policy – Controls permissions between CloudFront and S3

Github url : https://github.com/muralikrishna-sunkara/s3-static-website

Deployment Steps

  1. Initialize Terraform
terraform init
  1. Plan the deployment
terraform plan
  1. Apply the configuration
terraform apply
  1. Get your website URL
terraform output website_url

Key Features

Security First - S3 bucket blocked from public access, HTTPS by default ✅ Performance - Global CDN caching with 1-hour default TTL ✅ Cost Optimized - Typically under $1/month ✅ Versioning - Easy rollback if needed ✅ Infrastructure as Code - Version control your entire setup

Next Steps

  • Add custom domain name
  • Use AWS Certificate Manager for custom SSL
  • Set up CloudFront monitoring
  • Automate deployments with GitHub Actions