Skip to content
Latchkey

Terraform "Unsupported Terraform Core version" in CI

The terraform block can pin a required_version. When the runner's Terraform falls outside that constraint, Terraform stops immediately with "Unsupported Terraform Core version" before doing any work.

What this error means

any command fails with "Error: Unsupported Terraform Core version" stating the installed version does not meet the required_version constraint.

Terraform
Error: Unsupported Terraform Core version

  on versions.tf line 2, in terraform:
   2:   required_version = ">= 1.9.0"

This configuration does not support Terraform version 1.7.0. To proceed, either
choose another supported Terraform version or update this version constraint.

Common causes

CI installs a version outside the constraint

The runner pins an older (or newer) Terraform than required_version allows, so the constraint is violated.

A constraint bump without updating CI

The required_version was raised in code but the workflow still installs the old version.

How to fix it

Install a version that satisfies the constraint

  1. Read the required_version from the error.
  2. Set setup-terraform to a version inside that range.
  3. Re-run any command to confirm the constraint passes.
.github/workflows/ci.yml
- uses: hashicorp/setup-terraform@v3
  with:
    terraform_version: '1.9.0'

Align the constraint with what CI provides

If the pin is intentional, widen or adjust required_version to match the version your runners install.

versions.tf
terraform {
  required_version = ">= 1.7.0"
}

How to prevent it

  • Keep setup-terraform and required_version in sync.
  • Bump the constraint and the workflow version together.
  • Use a single version file shared by local and CI.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →