Download Terraform. Windows | Mac | Site
Unzip the folder, place it somewhere for example a folder inside Users called Terraform then copy that directory location.
C:\Users\<user>\VirtualMachines\Terraform
- Now navigate to your environment variables if you are on Windows. (search in start menu)
- Inside that select the Advanced tab and select the environmental variables.. option at the bottom.
- Inside there in the User Variables double click Path variables and then in the new window click New and add that path you copied into the new variable slot.
- To check it has been installed close any/ all bash instances you have running and then reopen one in administrator and type:
# Check if the terraform is installed
terraform --version
There are 2 sides of IAC
- Configuration Management
- Orchestration Tool
- Ansible - Configuration management
- Terraform - Orchestration
- Kubernetes - Orchestration is used in containerisation - i.e. Docker, Crio, Rocket.
- Orchestration tools to configure out instances and their AWS configurations remotely.
- Terraform files are created with .
tf
extension - Set Environment variables, via
Environmental variables
and add theACCESS
andSECRET
Keys as user variables. Terraform will automatically pick them up. - Make sure you refresh any current instances of
Git Bash
you have running as the environmental variables will not take effect until you have done that. Find the commands to create the instance below.
terraform init
# Check the steps inside the code
# lists either 'SUCCESS' or 'ERROR'
terraform plan
# This runs after everything has been checked
# Immplements the code (Deploy the infrastructure)
terraform apply