terraform-lint icon indicating copy to clipboard operation
terraform-lint copied to clipboard

Allow us to define to which terraform version run

Open abelnieva opened this issue 5 years ago • 4 comments

:speaking_head: Foreword

:person_frowning: Problem Statement

The current release use the latest terraform version for lint check, we have a lot of code under 0.12 version , running fmt with 0.14 fail.

:grey_question: Possible Solution

allow user choose terraform version to be checked

:arrow_heading_up: Describe alternatives you've considered

passing version as tag arg or create branchs for different terraform release eg tf12 , tf13, (tf14)

:heavy_plus_sign: Additional context

abelnieva avatar Dec 03 '20 12:12 abelnieva

Encountering same issue today. Because the Dockerfile in the project does not specify a tag: FROM hashicorp/terraform even though I have pinned this Action @ 1.0.0 I have been hit by a breaking change. Presumably because hashicorp/terraform:latest was updated to Terraform 14 yesterday

conzy avatar Dec 03 '20 12:12 conzy

So it looks like this will mean a fundamental rewrite of the action as it appears docker does not support the dynamic selection of image.

I will look into how to do this soon, though I aim not to change how you all interact with it except to add some parameter which will allow you to select the version.

On a side note does anyone have documentation of a way of installing the latest or a selected version of terraform dynamically?

Thanks!

xorima avatar Dec 03 '20 21:12 xorima

On a side note does anyone have documentation of a way of installing the latest or a selected version of terraform dynamically?

maybe we can use https://github.com/tfutils/tfenv or https://hub.docker.com/r/hashicorp/terraform/dockerfile

abelnieva avatar Dec 03 '20 21:12 abelnieva

So I've finally got back around to this (sorry about how long) and github actions still does not support dynamic from: in Dockerfile so I'm trying to work out if we want to add complexity to this or not in order to meet this requirement.

I will do some testing to find out if using tfenv is faster than pulling from dockerhub or not and make a decision based on the outcome of that (I know that Dockerfile based runs are not exactly fast after all)

xorima avatar Sep 28 '22 14:09 xorima