Install Terraform
Terraform is a command line tool that enables users to execute Terraform code. The tool allows users to validate their configuration, create, change, and destroy infrastructure based on code. For this lab, we will run Terraform locally but the actual execution will happen on the Terraform Enterprise box.
If you are on network, you may need to temporarily disconnect the VPN during the local setup steps for Git installation and SSH keys.
Install Terraform¶
You will need to install a command line interface if you do not have one already installed.
-
Use the CLI tool Git Bash, or if you're more comfortable with Windows scripting, install Powershell.
-
Then download Terraform 0.13.4 32-bit or download Terraform 0.13.4 64-bit and install using the binary.
-
After the download, create a folder on your C:\ that will be the home to your Terraform executable (e.g. C:\terraform)
-
Extract the zip file you downloaded and save it on the folder you created in the previous step.
-
In the start menu type 'environment' and open the option that says 'Edit the System Environment Variables'
-
In the new window, click on 'Environment Variables...' and under the 'System Variables' find the one called 'Path' and click edit.
-
In the new window, click 'New' and add the folder path where you saved the terraform.exe (folder you created in previous step)
-
Click OK on each menu that opened on this process. Make sure all the tabs are closed.
-
Open a new CMD/PowerShell.
Use the built in Terminal which has bash already installed. We will use tfenv
to manage the Terraform installation for us.
- Download tfenv
- Follow the instructions in the README to install
- Once installed, run
tfenv install 0.13.4 && tfenv use 0.13.4
Confirm the installation worked by running terraform version
.
Required Terraform Version
Terraform 0.14 won't work to run the next activities, make sure attendees have installed 0.13