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
- Read the required_version from the error.
- Set setup-terraform to a version inside that range.
- 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
Terraform state created by a newer Terraform version in CIFix Terraform "state snapshot was created by Terraform v... newer than current" in CI - the runner Terraform…
Terraform "Inconsistent dependency lock file" in CIFix Terraform "Error: Inconsistent dependency lock file" in CI - a required provider is missing from .terrafo…
Terraform "Module not installed" run init first in CIFix Terraform "Error: Module not installed" in CI - a referenced module was never fetched into .terraform/mod…