Install Terraform on Windows with Bash (original) (raw)

Terraform enables the definition, preview, and deployment of cloud infrastructure. Using Terraform, you create configuration files using HCL syntax. The HCL syntax allows you to specify the cloud provider - such as Azure - and the elements that make up your cloud infrastructure. After you create your configuration files, you create an execution plan that allows you to preview your infrastructure changes before they're deployed. Once you verify the changes, you apply the execution plan to deploy the infrastructure.

This article presents you with the options to authenticate to Azure for use with Terraform.

In this article, you learn how to:

1. Configure your environment

2. Install a terminal emulator

There are many options on Windows to run bash commands, including Git Bash and Windows Terminal. This article has been tested using Git Bash. Download and install Git Bash.

3. Install the Azure CLI

Install the Azure CLI. This article was tested using Azure CLI version 2.26.1.

4. Install Terraform for Windows

  1. Download Terraform. This article was tested using Terraform version 1.1.4.
  2. From the download, extract the executable to a directory of your choosing (for example, c:\terraform).
  3. Update your system's global PATH environment variable to include the directory that contains the executable.
  4. Open a terminal window.
  5. Verify the global path configuration with the terraform command.
terraform -version  

Troubleshoot Terraform on Azure

Troubleshoot common problems when using Terraform on Azure

Next steps