1. Install Terraform on your local system - AndyGreenPhD/ksu_labs GitHub Wiki
Terraform overview
Terraform is an "infrastructure as code" (IaC) tool developed by HashiCorp. Terraform uses human-readable text-based configuration files to define and create both cloud and on-prem resources. These configuration files can be created, viewed, and edited using a regular text editor. You can learn more about Terraform by visiting https://developer.hashicorp.com/terraform/intro
Students must install the Terraform application on their local system as the first step. Installation only has to be done once and does not need to be done on a per-lab basis.
Failure to properly install Terraform will result in students being unable to instantiate a cloud-based lab environment.
Installing Terraform is a fairly simple and straightforward process. We will outline the steps below for Windows and Mac users.
Installation steps
Windows
Tutorial video can be viewed here
- Download the appropriate package for your system from the Terraform downloads page. Make note of the directory you downloaded the zip file to, as you will need it in upcoming steps.
- Open a Command Prompt terminal by typing "cmd" in the Windows search bar and clicking on the "Command Prompt" application.
- Type mkdir "%HOMEPATH%\terraform" and press the Enter key to create a directory named terraform in your home directory.
- Type tar -zxvf LOCATION OF THE ZIP FILE -C "%HOMEPATH%\terraform" and press the Enter key. You must replace NAME OF THE ZIP FILE with the actual name of the zip file you downloaded, e.g. tar -zxvf terraform_1.6.6_windows_amd64.zip -C "%HOMEPATH%\terraform"
- Type exit and press the Enter key to close your Command Prompt terminal.
- Open the Windows start menu and type "Environment Variables"
- Click on the "Environment Variables" button.
- Under the "System variables" section, click on the "Path" variable and click the "Edit" button.
- Click the "New" button, add C:%HOMEPATH%\terraform in the text field and press the Enter key.
- Click on the OK button to close the panel.
- Open a Command Prompt and type terraform version to verify that Terraform is installed
Mac
Tutorial video can be viewed here
- Download the appropriate zip file for your system from the Terraform downloads page.
- Open a terminal and navigate to the directory where you downloaded the zip file to.
- Type unzip NAME OF THE ZIP FILE -d /usr/local/bin. You must replace NAME OF THE ZIP FILE with the actual name of the zip file you downloaded, e.g. unzip terraform_1.3.5_darwin_arm64.zip -d /usr/local/bin
- Type terraform version to verify that Terraform is installed and in your system's PATH.