This project sets up a static website hosting on AWS using Terraform. The architecture leverages AWS Route 53, CloudFront, S3, Certificate Manager, and a CloudFront Function to provide a highly available, scalable, and secure solution.
For a deeper understanding of this project and mastering static website hosting on AWS with Terraform, I recommend reading the following article on Medium:
Mastering Static Website Hosting on AWS with Terraform: A Step-by-Step Tutorial
Before deploying the infrastructure, it's crucial to set up the necessary variables. Terraform utilizes variables to manage settings in a flexible manner. Follow the steps below to configure your variables:
Creating a Variables File:
terraform.tfvars
in the project root.variables.tf
.# Example terraform.tfvars content
aws_region = "us-west-2"
prefix = "your-org-prefix"
domain_name = "yourdomain.com"
bucket_name = "website-name-frontend"
common_tags = {
ManagedBy = "Terraform"
Org = "My Organization name"
Project = "Static Website"
}
Initialize Terraform:
terraform init
Generate an Execution Plan:
terraform plan
Apply the Configuration:
terraform apply
To destroy the provisioned infrastructure, use:
terraform destroy
I appreciate your interest in this project and thank you for taking the time to explore it. Your involvement is crucial to the success and the community around the project.
Contributions to this project are welcomed! Whether it's reporting bugs, suggesting enhancements, or writing and refactoring code, your help is always appreciated. Feel free to open an issue or create a pull request.