Click on each book below to review & buy on Amazon.
As an Amazon Associate, I earn from qualifying purchases.
Terraform - Windows Install
This runbook guides you through the process of installing Terraform on a Windows system. Terraform is an open-source infrastructure as code software tool that enables you to safely and predictably create, change, and improve infrastructure.
Introduction
Before beginning the installation process, it is important to understand that Terraform is distributed as a single binary. Installing Terraform on Windows involves downloading the appropriate version for your system, extracting it, and configuring your system to recognize the Terraform command.
Determine OS Architecture
To ensure you download the correct Terraform binary for your system, first determine your Windows operating system architecture:
- Open a Powershell Admin Prompt. This can be done by right-clicking the Start menu and selecting "Windows PowerShell (Admin)".
-
Run the following command to determine your system's architecture:
wmic os get osarchitecture
This command will return whether your system is 32-bit or 64-bit.
Download Terraform
Downloading the correct Terraform binary for your system's architecture is crucial.
- Visit the Terraform download page. This page lists all available versions of Terraform for various operating systems.
- Set Operating System to Windows.
-
Depending on the architecture you determined earlier, select the appropriate Download link:
- 386 for 32-bit systems.
- AMD64 for 64-bit systems.
The link will download a zip file containing the Terraform binary.
Extract Zip
After downloading the Terraform binary, you need to extract it to a location on your system.
- Right-click on the downloaded zip file
terraform_(version)_windows_(architecture).zip
. - Select Extract all.
- Choose where to extract the files. For easier access and management, it is recommended to extract to C:\apps\terraform.
-
Select Extract.
This action creates a folder containing the Terraform executable.
Update Path Environment Variable
To use Terraform from any command line, its location needs to be added to the Path environment variable.
-
In the Powershell Admin prompt, run the following command to append Terraform's path to the system's Path environment variable:
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\apps\terraform", "Machine")
This command will allow you to run Terraform from any directory in the command prompt.
Installation Check
To verify that Terraform has been installed correctly:
- Relaunch PowerShell. This is necessary to refresh the environment variables and include the updated Path.
-
Run:
terraform -v
This command displays the installed version of Terraform, confirming a successful installation:
Terraform v1.4.5 on windows_amd64
Conclusion
You have now successfully installed Terraform on your Windows system. This tool will enable you to automate and manage your infrastructure with ease. Remember to periodically check for updates to ensure you have the latest features and security enhancements.
Support DTV Linux
Click on each book below to review & buy on Amazon. As an Amazon Associate, I earn from qualifying purchases.
NordVPN ®: Elevate your online privacy and security. Grab our Special Offer to safeguard your data on public Wi-Fi and secure your devices. I may earn a commission on purchases made through this link.