This project is of simple static website hosting using AWS S3 and terraform.
Static web page will load images.
Terraform script will create S3 bucket for hosting static website and other S3 bucket for storing website S3 bucket logging.
Below tool's setup should be available.
- Terraform Installation
- AWS CLI configuration using AWS programmatic user having appropriate access level.(In this project context
S3FullAccess
policy will work for CLI user)
1. Run Terraform Script
git clone https://github.com/Pratibha-28/Static-Website-Using-S3.git
cd Static-Website-Using-S3/terraform-scripts/static-website/
terraform init
terraform plan -var-file input.tfvars
terraform apply -var-file input.tfvars
Copy the website_endpoint from output
To remove/delete the AWS resources created by terraform script
terraform plan -var-file input.tfvars -destroy
terraform apply -var-file input.tfvars -destroy
2. Upload Website content in S3
cd Static-Website-Using-S3/test-s3-static-web/
aws s3 sync . s3://test-s3-static-web
3. Access the Website