# Hosting a Static Website on AWS with Terraform: My Tamil Nadu Tour Guide Project

> Source: <https://dev.to/divyapriya250413/hosting-a-static-website-on-aws-with-terraform-my-tamil-nadu-tour-guide-project-3ed5>
> Published: 2026-12-03 06:08:16+00:00

**Key takeaway:** A static S3 site can be fully provisioned with Terraform using a random_id suffix for global bucket-name uniqueness, a public-read bucket policy paired with relaxed Block Public Access, and aws_s3_object uploads that re-upload only changed files.

By Divyapriya S — Software Developer | Cloud Engineer

One command to build a website on AWS, and one command to remove it. That idea — Infrastructure as Code — is at the heart of my latest project.

I built the **Tamil Nadu Tour Guide**, a static website that helps visitors explore places in Tamil Nadu by type, plan a quick trip, discover local food, and open an AI guide built with PartyRock. Instead of clicking through the AWS console, I managed everything with **Terraform**.

**Live website:** [http://tamilnadu-tour-guide-6e9ce982.s3-website.ap-south-1.amazonaws.com/#places](http://tamilnadu-tour-guide-6e9ce982.s3-website.ap-south-1.amazonaws.com/#places)

**Source code:** [https://github.com/DivyaPriya250413/tn-tour-guide-terraform](https://github.com/DivyaPriya250413/tn-tour-guide-terraform)

`git clone`.`.tf` files and ran the workflow: `init` → `validate` → `plan` → `apply`.` index.html`, CSS and JavaScript — no web server needed.` random_id.suffix` — an 8-character hex suffix, because S3 bucket names must be globally unique`aws_s3_bucket.site` — the bucket `tamilnadu-tour-guide-6e9ce982`
`aws_s3_bucket_public_access_block.site` — relaxes Block Public Access for this bucket so the public policy can work`aws_s3_bucket_website_configuration.site` — enables website hosting with `error.html`
`aws_s3_bucket_policy.public_read` — allows public `s3:GetObject` so visitors can read the site`aws_s3_object.site_files` — uploads each file in `website/` with the correct content type, re-uploading only changed files
The result of `terraform apply`: Apply complete! Resources: 9 added, 0 changed, 0 destroyed. bucket_name = "tamilnadu-tour-guide-6e9ce982", website_url = "[http://tamilnadu-tour-guide-6e9ce982.s3-website.ap-south-1.amazonaws.com](http://tamilnadu-tour-guide-6e9ce982.s3-website.ap-south-1.amazonaws.com)"

`terraform.tfstate` lets `terraform destroy` removes everything Terraform created, and stopping the EC2 instance keeps costs low.
Visit the Tamil Nadu Tour Guide here: [http://tamilnadu-tour-guide-6e9ce982.s3-website.ap-south-1.amazonaws.com/#places](http://tamilnadu-tour-guide-6e9ce982.s3-website.ap-south-1.amazonaws.com/#places)

The full step-by-step guide, with every command explained, is in my PDF guide: [Hosting a Static Website on AWS with Terraform — The Tamil Nadu Tour Guide site, built with Amazon S3, EC2 and GitHub](https://github.com/DivyaPriya250413/tn-tour-guide-terraform/blob/main/Tamil-Nadu-Tour-Guide-AWS-Terraform-Guide.pdf)
