entur / gha-terraform

Repository with reusable workflows for terraform lint, plan and apply
European Union Public License 1.2
0 stars 2 forks source link

Support extracting terraform version from .tool-versions #44

Closed tommybo-entur closed 1 month ago

tommybo-entur commented 5 months ago

When using asdf-vm we specify terraform version in .tool-versions. It would be nice if this action automatically detects and use this version if available.

Notice that for our use the versions file is located in repository root, but I've seen other teams putting it in subfolders (i.e. \<root>/terraform).

Glenn-Terjesen commented 5 months ago

I think the tech-leads want to use :latest, but personally I see the value in setting the terraform version with asdf. Perhaps we can use the version input, ie: version: asdf to solve this.

egrimstad commented 1 month ago

Would be nice to use the version specified in asdf, since that is what harness uses, right?

bvestli commented 1 month ago

We had a discussion in team plattform about this and decided to close this issue. The reason is that we do not want to make asdf a tool used to set terraform version since it does not support parsing the version from required_version in the terraform code which is the correct way to specify which version of the Terraform CLI is allowed to run the configuration.

We will look more into good solutions if the outcome of the CD-pilot is to use GitHub for CD. But until we have made a decision about CD-tool we will leave this reusable workflow as-is.