Skip to content

Simple static website hosted in AWS, built with Terraform.

License

Notifications You must be signed in to change notification settings

saragerion/aws-static-website

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aws-static-website

Simple static website deployed to an AWS account of choice using Terraform.

The static website featured in this repository (src folder) is a sample used for testing purposes: HTML, CSS & JavaScript are taken from this codepen.

Technologies

  • Terraform;
  • AWS (S3, CloudFront, CloudWatch);
  • Bash;
  • HTML;
  • CSS;
  • JavaScript;

Prerequisites

  1. An AWS account;
  2. The following CLI software installed and correctly configured in your local environment:
  1. An S3 bucket already existing and located in your AWS account, where the Terraform state will be stored remotely;

Usage

Deploy the whole stack

# Make script executable
chmod +x ./scripts/deploy.sh

# Preview a Terraform infra deployment
./scripts/deploy.sh

# Deploy the whole stack
./scripts/deploy.sh apply

Deploy frontend assets only

# Make script executable
chmod +x ./scripts/deploy-frontend-assets.sh

# Deploy the static assets
./scripts/deploy-frontend-assets.sh

Deploy the Terraform infrastructure only

# Make script executable
chmod +x ./scripts/deploy-terraform.sh

# Preview a terraform infra deployment
./scripts/deploy-terraform.sh

# Deploy the Terraform infra
./scripts/deploy-terraform.sh apply

Destroy the entire stack

# Make script executable
chmod +x ./scripts/destroy-stack.sh

# Destroy all the Terraform infra (including the static frontend assets)
./scripts/destroy-stack.sh

Run a small load test

# Make script executable
chmod +x ./scripts/load-test.sh

# Sent HTTP requests to given url
./scripts/load-test.sh "https://xxxxxxxxxxx.cloudfront.net/"

TODO

  • Improve documentation;
  • Create deployment pipelines using Github Actions;

About

Simple static website hosted in AWS, built with Terraform.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published