MANUALLY - bucket → permissions → policy me edit (policy generator pe jake krlo and arn change krdo and last m /*) and ab ye host ho jayega

What is this?

Host a static website (HTML, CSS, JS) on S3 bucket - no server needed!

Website URL format:

http://{bucket-name}.s3-website.{region}.amazonaws.com

Steps Overview

  1. Create S3 Bucket (with unique name)
  2. Allow Public Access (by default S3 blocks everything)
  3. Add Bucket Policy (allow anyone to read files)
  4. Configure Website (tell S3 which file is homepage)
  5. Upload Files (HTML, CSS)
  6. Output URL (get the website link)

Resources Used

Resource Purpose
aws_s3_bucket Create the bucket
aws_s3_bucket_public_access_block Allow public access
aws_s3_bucket_policy Allow everyone to read files
aws_s3_bucket_website_configuration Enable website hosting
aws_s3_object Upload files to bucket
output Get website URL

📄 Reference:

Kuch yaad na rahe so chill yaha se refer karo sidha but steps pta honi chahiye kese work krta h manually and terraform se.

https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_website_configuration