CircleCI-Public / terraform-orb

Deploy your infrastructure via a CircleCI pipeline using the Terraform orb. Integrate Infrastructure-as-Code (IaC) to help provision and manage any cloud, infrastructure, or service of your choice.
https://circleci.com/orbs/registry/orb/circleci/terraform
MIT License
10 stars 44 forks source link

`terraform/install` with `latest` fails #87

Closed tprobinson closed 1 year ago

tprobinson commented 2 years ago

Orb Version 3.1.0

Describe the bug When using the terraform/install step with terraform_version: latest, shasum checking fails because it's using the wrong variable for the name of the file.

To Reproduce Run a job with a step like this:

      - terraform/install:
          terraform_version: latest

Expected behavior terraform/install should work with latest

Additional context Logs from usage:

Using Terraform version '1.2.9'
2022-09-17 01:06:11 URL:https://releases.hashicorp.com/terraform/1.2.9/terraform_1.2.9_linux_amd64.zip [19906116/19906116] -> "terraform_1.2.9_linux_amd64.zip" [1]
2022-09-17 01:06:11 URL:https://releases.hashicorp.com/terraform/1.2.9/terraform_1.2.9_SHA256SUMS [1378/1378] -> "terraform_1.2.9_SHA256SUMS" [1]
cat: terraform_latest_SHA256SUMS: No such file or directory
sjparkinson commented 1 year ago

This is also true when using a value such as "1.3" for terraform_version.

Seems like tf_version should be passed into and used by most functions at:

https://github.com/CircleCI-Public/terraform-orb/blob/13b74aead348ded3ee3dcbd3dcb1471dcf05ee5d/src/scripts/install.sh#L75-L81

Sithira commented 1 year ago

The same issue exists for TF version 1.4.0