Infrastructure As Code With Terraform: Module Checklist
Infrastructure As Code With Terraform: Module Checklist
Infrastructure as Code
with Terraform
Demo Projects
Introduction to Terraform
❏ Watched video
Useful Links:
Providers
❏ Watched video
❏ Demo executed:
❏ Use AWS Provider
Useful Links:
❏ Watched video
❏ Demo executed
❏ Created new VPC
❏ Created Subnet in that new VPC
❏ Created new Subnet in existing default VPC (with data)
Useful Links:
● Project: https://gitlab.com/nanuchi/terraform-learn/-/tree/master
Useful Links:
● Project: https://gitlab.com/nanuchi/terraform-learn/-/tree/master
Useful Links:
● Project: https://gitlab.com/nanuchi/terraform-learn/-/tree/master
Check your progress... 3/11
Terraform State
❏ Watched videos
❏ Demo executed
Useful Links:
● Project: https://gitlab.com/nanuchi/terraform-learn/-/tree/master
Terraform Output
❏ Watched video
❏ Demo executed - define output values
Useful Links:
● Project: https://gitlab.com/nanuchi/terraform-learn/-/tree/master
Variables
❏ Watched video
❏ Demo executed:
❏ Passed variables in 3 different ways
❏ Restricted value of variable by defining a type
Useful Links:
Environment variables
❏ Watched video
❏ Demo executed:
❏ Used environment variables to extract AWS credentials
❏ Set variable using TF_VAR_name environment variable
Useful Links:
Best Practices:
● With Terraform: Create own VPC and leave the defaults created by AWS as is
● Security: Store your .pem file ssh private key in .ssh folder. Restrict permission
(only read for our User) on .pem file
● Security: Don’t hardcode public_key in Terraform config file!
Check your progress... 7/11
Provisioners
❏ Watched video
❏ Demo executed:
❏ Used “remote-exec” provisioner
❏ Used “file” provisioner
❏ Used “local-exec” provisioner
Useful Links:
● Project Repo:
https://gitlab.com/nanuchi/terraform-learn/-/tree/feature/provisioners
Best Practices:
Modules (Part 1, 2, 3)
❏ Watched videos
❏ Demo executed:
❏ Extracted output values, variables and providers into its own file
❏ Created subnet module and used it in root config file
❏ Created webserver module and used it in root config file
❏ Executed terraform apply successfully
Useful Links:
Best Practices:
● Terraform Project Structure: Own .tf file for providers, variables, data sources and
output values
● Modules: encapsulate configuration into distinct logical components
Check your progress... 8/11
Useful Links:
Useful Links:
● Project Repo:
https://gitlab.com/nanuchi/java-maven-app/-/tree/feature/sshagent-terraform
● Install Terraform: https://learn.hashicorp.com/tutorials/terraform/install-cli
● Install docker-compose: https://docs.docker.com/compose/install/
● Terraform environment variables:
https://www.terraform.io/docs/commands/environment-variables.html
Best Practice:
Useful Links:
● Project Repo:
https://gitlab.com/nanuchi/java-maven-app/-/tree/feature/sshagent-terraform
● Backends: https://www.terraform.io/docs/backends/
● Remote State: https://www.terraform.io/docs/state/remote.html
● AWS S3: https://aws.amazon.com/s3/
Best Practice: