GKE auto pilot-Terraform module “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 - https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/tree/v30.2.0/modules/beta-autopilot-private-cluster

Issue:-

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

current 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? Please share your thoughts on this.

5 Likes

Hi @Dg03cloud

Welcome to Google Cloud Community!

Your Terraform issue can be better investigated by Terraform experts. You can reach out to the Terraform Community as well as the Github - Terraform Community and search for similar issues or post your issue and get answers from their experts.

I hope this information is helpful.

If you need further assistance, you can always file a case with our support team.

5 Likes