How to upgrade version of terraform in windows

How to upgrade version of terraform in windows. Now i am using 0.9 and on windows using git bash. can someone help me with the process or commands. Note: I did some google search but no use. Thanks

4 Answers

I know you specified using bash but this is the first answer that comes up in searches so this is more FYI for future travelers.

To find the location of terraform.exe in powershell:

(get-command terraform.exe).Path

I had used Chocolaty to install Terraform so to upgrade:

choco upgrade terraform
1

This is using Git Bash on Windows

  1. Download the latest version and unzip it
  2. Navigate to that folder through your bash CLI
  3. Now type which terraform
  4. Copy the path of the terraform
  5. Now type
    cp terraform.exe <your Terraform path>
    e.g. cp terraform.exe /c/WINDOWS/System32/terraform
  6. Now check by using
    terraform --version

Use

choco install terraform --version=0.12.14 --force 

to install version that you like.

1

Firstly, I would read the upgrade guides written by Hashicorp to make upgrading versions transparent. In your case I would read both 0.10 and 0.11 as they're likely to have changes that will affect you.

Secondly, in addition to this test in isolation with later versions of Terraform, i.e. not using remote state file and in a sandbox environment.

Lastly, locate where the current Terraform binary is located, perhaps check your Environment Variables for a PATH that may lead to where the executable is, and replace that with the latest version of Terraform which you can download here.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like