Skip to main content
Knowledge Base

Gruntwork Pipelines using wrong terraform version

Answer

I've finally got Gruntwork Pipelines running. However, it's using the wrong version of terraform (see below). What is the correct way to use a specific terraform version in Pipelines? I tried using the `.gruntwork/config.yml` file in infra-live, resulting in the output below. (.gruntwork/config.yml) ``` pipelines: cli-version: v0.2.4 terraform-version: 1.5.5 terragrunt-version: 0.50.14 ``` ``` Installing Terraform v1.5.5 Downloading release tarball from https://releases.hashicorp.com/terraform/1.5.5/terraform_1.5.5_linux_amd64.zip #=#=# 0.0% 0.1% # 2.5% ### 5.1% ################### 27.7% ########################### 37.7% ################################### 49.9% ###################################### 53.9% ############################################# 63.6% ##################################################### 74.1% ############################################################# 85.1% ######################################################################## 100.0% Downloading SHA hash file from https://releases.hashicorp.com/terraform/1.5.5/terraform_1.5.5_SHA256SUMS Not instructed to use Local PGP (/home/runner/.tfenv/use-{gpgv,gnupg}) & No keybase install found, skipping OpenPGP signature verification Archive: /tmp/tfenv_download.u8wWoG/terraform_1.5.5_linux_amd64.zip inflating: /home/runner/.tfenv/versions/1.5.5/terraform Installation of terraform v1.5.5 successful. To make this your default version, run 'tfenv use 1.5.5' Switching default version to v1.5.5 Default version (when not overridden by .terraform-version or TFENV_TERRAFORM_VERSION) is now: 1.5.5 2023/12/05 01:21:36 Creating directory for terragrunt: /home/runner/.terragrunt.versions/ Downloading https://github.com/gruntwork-io/terragrunt/releases/download/v0.50.14/terragrunt_linux_amd64 to terragrunt_linux_amd64 Downloading ... 47453543 bytes downloaded. Switched terragrunt to version "0.50.14" Run dsaltares/fetch-gh-release-asset@1.1.1 Run sudo mv /tmp/pipelines /usr/local/bin/pipelines Run echo "MACHINE_USER_NAME=$(gh api /user | jq .login)" >> "$GITHUB_OUTPUT" Run # CD Infra-live directory && Run Pipelines-execute time="2023-12-05T01:21:39Z" level=info msg="This program sends telemetry to Gruntwork. To disable, set PIPELINES_TELEMETRY_OPT_OUT=true as an environment variable" binary=pipelines version=v0.2.4 time="2023-12-05T01:21:39Z" level=info msg="Configuring git to use HTTPS with the provided machine user token and name" binary=pipelines version=v0.2.4 time="2023-12-05T01:21:39Z" level=info msg="Starting Pipelines executor..." binary=pipelines version=v0.2.4 time="2023-12-05T01:21:39Z" level=info msg="Checking out branch: 5e2dec8897f7450c1877c997072fe797f0e6c4fe" binary=pipelines version=v0.2.4 HEAD is now at 5e2dec8 Add `.terraform-version` file time="2023-12-05T01:21:39Z" level=info msg="Current working directory: /home/runner/work/infrastructure-pipelines/infrastructure-pipelines/infrastructure-live" binary=pipelines version=v0.2.4 time="2023-12-05T01:21:39Z" level=info msg="Changed into directory: dev/us-east-2/dev/data-stores/s3/hrg-dev-backup-archives" binary=pipelines version=v0.2.4 time="2023-12-05T01:21:39Z" level=info msg="Executing Terragrunt with args: plan" binary=pipelines version=v0.2.4 Initializing the backend... Successfully configured the backend "s3"! Terraform will automatically use this backend unless the backend configuration changes. Initializing modules... Downloading git::ssh://git@github.com/gruntwork-io/terraform-aws-security.git?ref=v0.69.0 for s3_bucket_logs... - s3_bucket_logs in .terraform/modules/s3_bucket_logs/modules/private-s3-bucket Downloading git::ssh://git@github.com/gruntwork-io/terraform-aws-security.git?ref=v0.69.0 for s3_bucket_primary... - s3_bucket_primary in .terraform/modules/s3_bucket_primary/modules/private-s3-bucket Downloading git::ssh://git@github.com/gruntwork-io/terraform-aws-security.git?ref=v0.69.0 for s3_bucket_replica... - s3_bucket_replica in .terraform/modules/s3_bucket_replica/modules/private-s3-bucket ╷ │ Error: Unsupported Terraform Core version │ │ on provider_version_override.tf line 3, in terraform: │ 3: required_version = "<= 1.5.5" │ │ This configuration does not support Terraform version 1.6.4. To proceed, │ either choose another supported Terraform version or update this version │ constraint. Version constraints are normally set for good reason, so │ updating the constraint may lead to other errors or unexpected behavior. ╵ ``` --- <ins datetime="2023-12-05T01:37:24Z"> <p><a href="https://support.gruntwork.io/hc/requests/110616">Tracked in ticket #110616</a></p> </ins>

Hey @jeffreymlewis , thanks for your PR. We've taken a slightly different tactic in this PR: https://github.com/gruntwork-io/pipelines-execute/pull/9 Do you mind confirming that as of the latest release the action is working in your environment? Apologies for the delay in resolution.