Terraform "no available releases match" provider constraint in CI
init resolves a single provider version that satisfies every constraint from the root and all modules. When those constraints conflict or no published version fits, no solution exists.
What this error means
init fails with "no available releases match the given constraints" for a provider. It surfaces when modules pin incompatible ranges, or a constraint excludes every published version.
terraform
Error: Failed to query available provider packages
Could not retrieve the list of available versions for provider hashicorp/aws:
no available releases match the given constraints >= 5.0.0, < 4.67.0Common causes
Conflicting constraints across modules
The root and a module (or two modules) pin ranges that do not overlap, so no single version satisfies all of them.
Constraint excludes all releases
A typo or an impossible range (e.g. >= 5.0.0, < 4.67.0) leaves no published version to choose.
How to fix it
Reconcile the version constraints
Align the root and module constraints to an overlapping, satisfiable range.
versions.tf
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.40.0, < 6.0.0" # overlaps every module's range
}
}
}Diagnose which constraint conflicts
- Run init with TF_LOG=debug to see each constraint and its source.
- Loosen or correct the range that excludes all versions.
- Re-run init to confirm a single version resolves.
How to prevent it
- Keep root and module provider constraints compatible.
- Avoid impossible ranges; double-check upper/lower bounds.
- Upgrade modules to versions with current constraints.
Related guides
Terraform "no available provider ... matches the given constraints"Fix Terraform "no available provider ... versions match the given constraints" in CI - when root and module c…
Terraform "Failed to query available provider packages" in CIFix Terraform "Failed to query available provider packages" in CI - a transient registry timeout when listing…
Terraform "Could not retrieve the list of available versions for provider"Fix Terraform init "Could not retrieve the list of available versions for provider" in CI - a version constra…