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).PathI had used Chocolaty to install Terraform so to upgrade:
choco upgrade terraform 1 This is using Git Bash on Windows
- Download the latest version and unzip it
- Navigate to that folder through your bash CLI
- Now type which terraform
- Copy the path of the terraform
- Now type
e.g.cp terraform.exe <your Terraform path>cp terraform.exe /c/WINDOWS/System32/terraform - Now check by using
terraform --version
Use
choco install terraform --version=0.12.14 --force to install version that you like.
1Firstly, 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.