Skip to content

Pratibha-28/Static-Website-Using-S3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Static Website Hosting Using S3 And Terraform

Description

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 are the steps for running terraform script on Windows.

System Prerequisites

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

image

terraform plan -var-file input.tfvars

image

terraform apply -var-file input.tfvars

image

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

image

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

image

References

About

Static Website Hosting Using S3 And Terraform

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published