Install Terraform On Windows 10

In this blog post, I will show you how to install Terrafrom on a Windows 10 machine.

About Terraform

Terraform is an open source multi cloud Infrastructure as a Code (IaC) tool.

Important: It is highly recommended you install Terraform on Windows 10 using Chocolatey.

Note: To install Terraform on Linux visit this post.

Using Terraform we can deploy, modify and delete workloads in Azure, AWS and GCP.

The key benefit of Terraform is automation and reusability of code to provision and de-provison resources.

Download and Save

To download Terraform, go to the website below and download the windows vewrsion.

https://www.terraform.io/downloads.html

Save the file.

File name: 
Save as type: Compressed (zipped) Folder r. zip) 
de Folders

Unzip the file to c:\terraform.

Today (1) 
terraform_O.
Select a Destination and Extract Files 
Files will be extracted to this folder: 
Z] Show extracted files when complete

Below you can see the Terraform application.

terraform.exe 
Date modfied 
28/05/2020 3:24 дм 
туре 
App[ication

Add to PATH

For Terraform to work, we need to add the path below to the Windows PATH.

c:\terraform

Open Control Panel -> click on Systems -> Click on Advanced tab.

From the Advanced menu, click on Environment Variables

System Properties 
Computer Name Hardw"/ Advanced System Protection Remote 
You must be Bgged on as an Administrator to make most of these changes 
P effomance 
Visual effects. processor scheduling memory usage. and virtual memory 
Setting em 
user Profiles 
Desktop settings related to your sign-in 
Settings n 
Startup and Recovery 
System startup system failure. and debugging information 
Settings n 
Environment Variables n

From the User variables section, Click on Path

User variables for 
Variable 
OneDrive 
OneDriveComm 
OneDriveConsu 
Path 
TEMP

Add the following path

c:\terraform
山 , 0 」 丄 \ 0

Restart you command line tools or VS code and type

terraform
PS C: Repo> terraform 
Usage: terraform [ -version] [ -help] <command> [args] 
The available commands for execution are listed below. 
The most camion, useful commands are shown first, followed by 
less common or more advanced commands. If you're just getting 
started with Terraform, stick with the common commands. For the 
other commands, please read the help and docs before usage. 
Conunon commands : 
apply 
console 
destroy 
graph 
import 
init 
login 
logout 
output 
plan 
Builds or changes infrastructure 
Interactive console for Terraform interpolations 
Destroy Terraform-managed infrastructure 
Workspace management 
Rewrites config files to canonical format 
Download and install modules for the configuration 
Create a visual graph of Terraform resources 
Import existing infrastructure into Terraform 
Initialize a Terraform working directory 
Obtain and save credentials for a remote host 
Remove locally-stored credentials for a remote host 
Read an output from a state file 
Generate and show an execution plan

Processing…
Success! You're on the list.

Posted

in

by