Skip to content

This project sets up a static website hosting architecture on AWS using IaC (Infrastructure as Code) with Terraform. The solution is implemented including AWS services like Route53, CloudFront, S3, Amazon Certificate Manager to provide a highly available, scalable and secure hosting environment.

Notifications You must be signed in to change notification settings

LouisGreive/CloudWebHost

Repository files navigation

Cloud Web Host

Project Overview

This project sets up a static website hosting architecture on AWS using IaC (Infrastructure as Code) with the Terraform. The solution is implemented including AWS services like Route53, CloudFront, S3, Amazon Certificate Manager to provide a highly available, scalable and secure hosting environment.

Features

  • Static content hosting: stores website files (HTML) in a private S3 Bucket.
  • Global content delivery: uses CloudFront for low-latency delivery across edge locations worldwide
  • Secure access: Enforces HTPPS using SSL/TLS certificates managed by ACM -Flexible infrastructure: Automated setup with Terraform, ensuring consistency and replicability
  • DNS Management: Configures Route53 for custom domain integration

Getting Started

Prerequisites

  • Install Terraform.
  • Configure AWS CLI with your credentials (aws configure).
  • Ensure you have programmatic access enabled for your AWS account.

Setup Instructions

  1. Clone the Repository:
git clone https://github.com/LouisGreive/CloudWebHost
cd CloudWebHost
  1. Configure Variables:
  • Edit the file named terraform.tfvars in the root directory.
  • Define values for the required variables:
# The primary region in which your AWS resources (like S3, Route53, etc.) will be created.
aws_region  = "your-region"
# The domain name you want to manage in Route53 and use for the CloudFront distribution.
domain_name = "yourdomain.com"
# The name of the S3 bucket that will host your static website files.
bucket_name = "website-name-frontend"
# Common tags to apply to various resources, aiding in cost allocation and organization.
common_tags = {
  ManagedBy = "Terraform"
  Project   = "Static Website"
  1. Deploy the infrastructure:
  • Initialize Terraform:
terraform init
  • Plan the changes:
terraform plan
  • Apply the configuration:
terraform plan
  • Confirm by typing yes when prompted
  1. Access the website:
  • Terraform outputs the CloudFront URL
  • Open the URL in a browser to view the deployed website.

Testing

  • Verified the site’s global accessibility by testing from different regions.
  • Updated S3 content to validate cache behavior in CloudFront.
  • Confirmed secure HTTPS access and restricted S3 permissions.

Cleanup

To remove all resources created by terraform, run:

terraform destroy

Contribution

Contributions to this project are welcome!

  • Report bugs, suggest enhancements, or contribute code.
  • Feel free to open an issue or submit a pull request.

Acknowledgments

Project developed as part of the Cloud Programming Module in the Bachelor of Applied Artificial Inteligence program at IU International University of Applied Sciences.

Special thanks to the program tutor : Mr Georgi Dimchev.

About

This project sets up a static website hosting architecture on AWS using IaC (Infrastructure as Code) with Terraform. The solution is implemented including AWS services like Route53, CloudFront, S3, Amazon Certificate Manager to provide a highly available, scalable and secure hosting environment.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages