In this article, we will see Installation of Terraform On Windows Machine.
Steps to Follow :
Download Terraform software
Set the Environment variables
1. Download Terraform Software
First, we need to Terraform official website by using below link.
Select Windows and click on 64-bit to download.
We can the software has downloaded in your physical location in the zip format.
Extract Terraform Zip file
Once unzip it will be extracted to different folder.
Go inside the terraform folder there we can see the terraform executable file.
copy the terraform software to another drive
we can copy the software from C drive to E drive because software should be safe.
2. Install Terraform
For installing the terraform we need to give double click on terraform executable file so It will be run the executable file automatically means like terraform has installed.
Verify the terraform
Go to terraform software location
Type cmd in the path so command prompt will be opened inside the software location.
Verify Terraform Version
Here we are in the terraform software location and verify terraform version
Go to root and verify terraform
It showing error like not recognized as an internal or external command.
We can the terraform where software is located.
We can’t run the terraform from any location.
If we want to run the terraform from any location we need to set the environment variables.
3. Set the Environment Variable for terraform
Go to search and type env then click on Edit the system environment variables to open.
Select path and click on Edit.
Click on New.
Copy the terraform software path and specify in environment variables.
Specify software path which was copied and click on ok.
Click on Ok.
we have set the environment variables successfully
Now onwards we can run the terraform from any location.
Microsoft Windows [Version 10.0.18362.357]
(c) 2019 Microsoft Corporation. All rights reserved.
Use Terraform from any location
Usage: terraform [-version] [-help] <command> [args]
The available commands for execution are listed below.
The most common, 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.
apply Builds or changes infrastructure
console Interactive console for Terraform interpolations
destroy Destroy Terraform-managed infrastructure
env Workspace management
fmt Rewrites config files to canonical format
get Download and install modules for the configuration
graph Create a visual graph of Terraform resources
import Import existing infrastructure into Terraform
init Initialize a Terraform working directory
login Obtain and save credentials for a remote host
logout Remove locally-stored credentials for a remote host
output Read an output from a state file
plan Generate and show an execution plan
providers Prints a tree of the providers used in the configuration
refresh Update local state file against real resources
show Inspect Terraform state or plan
taint Manually mark a resource for recreation
untaint Manually unmark a resource as tainted
validate Validates the Terraform files
version Prints the Terraform version
workspace Workspace management
All other commands:
0.12upgrade Rewrites pre-0.12 module source code for v0.12
0.13upgrade Rewrites pre-0.13 module source code for v0.13
debug Debug output management (experimental)
force-unlock Manually unlock the terraform state
push Obsolete command for Terraform Enterprise legacy (v1)
state Advanced state management
Execution steps for terraform :
Ramesh’s Linkedin : Ramesh Atchala