Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

terraform-root

Root Terraform configuration that consumes all infrastructure modules from separate repos.

Repo Architecture

Repo Purpose
terraform-module-vpc Creates an AWS VPC
terraform-module-subnet Creates subnets inside a VPC
terraform-module-ec2 Creates EC2 instances + Security Groups
terraform-module-s3 Creates S3 bucket with encryption & versioning
terraform-root (this repo) Wires all modules together per environment

Usage

First-time Setup

terraform init

Deploy Dev

terraform workspace new dev
terraform workspace select dev
terraform plan  -var-file="envs/dev.tfvars"
terraform apply -var-file="envs/dev.tfvars"

Deploy UAT

terraform workspace new uat
terraform workspace select uat
terraform plan  -var-file="envs/uat.tfvars"
terraform apply -var-file="envs/uat.tfvars"

Deploy Prod

terraform workspace new prod
terraform workspace select prod
terraform plan  -var-file="envs/prod.tfvars"
terraform apply -var-file="envs/prod.tfvars"

Environment Differences

Feature Dev UAT Prod
VPC CIDR 10.0.0.0/16 10.1.0.0/16 10.2.0.0/16
EC2 Instance Type t2.micro t2.small t3.medium
SSH Access Open Open VPC-only
Termination Protection No No Yes
S3 Versioning Suspended Suspended Enabled
S3 force_destroy Yes Yes No

Replace <your-org> in main.tf source URLs with your actual GitHub organisation or username.

About

terraform-root

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages