GCP GKE Terraform Error: Failed to query available provider packages

I’m trying to create a GKE auto pilot cluster through terraform. Followed this reference to create a gke module - terraform-google-kubernetes-engine/modules/beta-autopilot-private-cluster at v30.2.0 · terraform-google-modules/terraform-google-kubernetes-engine · GitHub

Error:-
When I run terraform init, I’m receiving the below error “Error: Failed to query available provider packages” I also tried to run the terraform init -upgrade, but I’m still getting the same error.

│ Error: Failed to query available provider packages
││ Could not retrieve the list of available versions for provider hashicorp/google: no available releases match the given constraints >= 2.15.0, >= 3.33.0, >=
│ 3.43.0, >= 3.45.0, >= 3.53.0, >= 3.64.0, >= 3.83.0, >= 4.28.0, >= 5.0.0, < 5.0.0, >= 5.9.0, < 6.0.0

versions.tf:-

terraform {
required_version = “>=1.3”

required_providers {
google = {
source = “hashicorp/google”
version = “>= 5.9.0, < 6”
}
google-beta = {
source = “hashicorp/google-beta”
version = “>= 5.9.0, < 6”
}
kubernetes = {
source = “hashicorp/kubernetes”
version = “~> 2.10”
}
random = {
source = “hashicorp/random”
version = “>= 2.1”
}
}
provider_meta “google-beta” {
module_name = “blueprints/terraform/terraform-google-kubernetes-engine:beta-autopilot-private-cluster/v30.2.0”
}
}

What modification do I have to make in the terraform module versions.tf? Is there any reference link to support this error? Any helpful thoughts on this issue.

Hi @devvsgtfcloudspace,

It seems like you have multiple modules that use this provider and that there is no single version of the provider that they are all compatible with, so Terraform cannot satisfy their dependencies.

You can use the command terraform providers to review the requirements for each of your modules individually. You will need to select modules that can all agree on at least one version of this provider that they are all compatible with.