Hosting a statically-generated website on AWS using Terraform Cloud
Introduction
After preparing for the AWS and Terraform associate exams, I decided to build a small project to put some concepts into practice. Additionally, I took the chance to explore Terraform Cloud (TFC).
Objective: Host a statically-generated website on AWS
Design Decisions (DD):
- AWS services will be provisioned and managed using Terraform
- TFC workspaces/modules & GitHub repositories will be provisioned and managed using Terraform
- Terraform HCL code used by TFC will be stored in GitHub repositories for version controlled goodness. TFC will manage and store the Terraform state files.
- Website files will be stored in a GitHub repository and GitHub Actions will be used to build and sync the website files to AWS. In this instance, I'm using the statically-generated website framework Material for MkDocs to build the website from markdown files.
- Website will be deployed to a test environment before rolling out to the production environment
- Production website will be served using CloudFront. Test website will be served using native S3 static website hosting
- Monthly run costs should be kept as loss as possible