microsoft / azure-pipelines-terraform

Azure Pipelines tasks for installing Terraform and running Terraform commands in a build or release pipeline.
MIT License
95 stars 59 forks source link

Terraform: Unable to get latest version: using 1.1.6 #216

Open jordancparker opened 2 months ago

jordancparker commented 2 months ago

TerraformV1 failing to find the most recent version of terraform. Below is an included log identifying that its now pivoted back to 1.1.6 with the current release being 1.8.0.

Would it be possible to investigate and resolve the issue.

It may be worth increasing the v1.1.6, luckly we had minimum version checks in the pipeline to defend against falling 6 minor versions back.

==============================================================================
Task         : Terraform tool installer
Description  : Find in cache or download a specific version of Terraform and prepend it to the PATH
Version      : 0.203.0
Author       : Microsoft Corporation
Help         : [Learn more about this task](https://aka.ms/AAf1a0p)
==============================================================================
Getting latest Terraform version.
Unable to get latest version: using 1.1.6
Downloading: https://releases.hashicorp.com/terraform/1.1.6/terraform_1.1.6_linux_amd64.zip

I can see in the code base below, that the default is set to 1.1.6, which correlates to the pipeline above.

https://github.com/microsoft/azure-pipelines-terraform/blob/648beac95fde31be0f57ea6e872a5261a60a38a6/Tasks/TerraformInstaller/TerraformInstallerV1/src/terraform-installer.ts#L27

mericstam commented 2 months ago

Hi, I will see if Hashicorp changed something on their end, but I think I will remove that fallback as it quickly gets outdated. I think it will be better to fail it no versions is found and state to check the version manually on terraform page.

mericstam commented 2 months ago

Hi, Checked code and Hashicorps endpoint. everything seems to be working. If you are behind a proxy I would check if https://checkpoint-api.hashicorp.com/v1/check/terraform is allowed through the proxy.