terraform-google-modules / terraform-google-gcloud

Executes Google Cloud CLI commands within Terraform
https://registry.terraform.io/modules/terraform-google-modules/gcloud/google
Apache License 2.0
140 stars 96 forks source link

Update provider version constraint to support latest - v5.0.0 #171

Closed jaykoll closed 1 year ago

jaykoll commented 1 year ago

TL;DR

Unable to install hashicorp/google provider when referencing this module since the versions.tf file has a constraint < 5.0.0

-> https://github.com/terraform-google-modules/terraform-google-gcloud/blob/master/versions.tf#L23

Expected behavior

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.

Observed behavior

│ Error: Failed to query available provider packages
│ 
│ Could not retrieve the list of available versions for provider
│ hashicorp/google-beta: no available releases match the given constraints
│ >= 3.43.0, >= 5.0.0, < 5.0.0

Terraform Configuration

terraform {
  required_version = ">= 1.0.8"

  required_providers {
    google = {
      source  = "hashicorp/google"
      version = ">=5.0.0"
    }
  }
}

module "gcloud" {
  source  = "terraform-google-modules/gcloud/google"
  version = "3.2.1"
  create_cmd_entrypoint  = "gcloud"
  create_cmd_body        = "auth list"
}

Terraform Version

Terraform v1.5.7