Skip to content

An Infrastructure as Code exercise using Terraform to build infrastructure for a personal website in AWS.

Notifications You must be signed in to change notification settings

m3dev1/terraform-automatt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

terraform-automatt

AutoMatt.sh infrastructure created using Infrastructure as Code with Terraform.

Introduction

This project was created to put my Terraform learning into practice by converting my portfolio website, AutoMatt.sh hosted in AWS, to Infrastructure as Code using HashiCorp Terraform.

See it live

The inspiration

Features

  • AWS S3
    • Bucket versioning
    • Uploads files to S3 bucket
    • ACLs to block public access
    • S3 bucket policy using Origin Access Control
  • AWS CloudFront Distribution
    • Error pages (404, 403)
    • Cache policies
  • AWS CloudFront Functions
    • Redirect handling for resume
  • AWS Origin Access Control
    • S3 bucket policy
  • AWS Certificate Manager
    • SSL/TLS certificates

Prerequisites

  • Static site generated files in /home/m3/dev/dimension/_site, or update path in variables.tf.
  • AWS CLI to configure AWS credentials using aws configure.
  • Terraform to execute the code using terraform plan and terraform apply.

Setup

# Clone repo.
git clone https://github.com/m3dev1/terraform-automatt.git

# Replace placeholder text with actual values.
vim terraform-automatt/secrets.tf

# Configure site path directory
vim terraform-automatt/variables.tf

# See the plan of what Terraform will do.
terraform plan

# If plan looks good, approve the apply action.
terraform apply --auto-approve

Important

The entire process running from scratch will take about 15 minutes or so for everything to come online. This is primarily due to the time that it takes to configure CloudFront and upload the files to S3.

About

An Infrastructure as Code exercise using Terraform to build infrastructure for a personal website in AWS.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages