Skip to content

encryption_key dependency incompatible with module dependency #420

@felipe-notilus

Description

@felipe-notilus

TL;DR

Inconsistent google provider version. It lists google >= 6.9.0, < 8, while at the same time referencing the module encryption_key (~> 4.0) which only allows for the google provider ">= 5.31.0, < 7".

Expected behavior

The initialization of my terraform state.

Observed behavior

│ 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 >= 5.31.0, >= 6.9.0, ~> 7.0, < 7.0.0, < 8.0.0

Terraform Configuration

terraform {
  required_version = ">=1.1.0, <2.0.0"

  required_providers {
    google = {
      source  = "hashicorp/google"
      version = "~> 7.0" # explicitly require 7.x
    }
    google-beta = {
      source  = "hashicorp/google-beta"
      version = "~> 7.0"
    }
  }
}

provider "google" {
  project = "my-test-project"
  region  = "europe-west1"
}

provider "google-beta" {
  project = "my-test-project"
  region  = "europe-west1"
}

module "terraform_bucket" {
  source  = "terraform-google-modules/cloud-storage/google//modules/simple_bucket"
  version = "~> 11.1" # current latest

  name       = "my-test-terraform-bucket"
  project_id = "my-test-project"
  location   = "EU"
}

Terraform Version

Terraform v1.9.8
on darwin_arm64

Your version of Terraform is out of date! The latest version
is 1.13.1. You can update by downloading from https://www.terraform.io/downloads.html

Terraform Provider Versions

Providers required by configuration:
.
├── provider[registry.terraform.io/hashicorp/google-beta] ~> 7.0
├── provider[registry.terraform.io/hashicorp/google] ~> 7.0
└── module.terraform_bucket
    ├── provider[registry.terraform.io/hashicorp/google] >= 6.9.0, < 8.0.0
    └── module.encryption_key
        └── provider[registry.terraform.io/hashicorp/google] >= 5.31.0, < 7.0.0

Additional information

The module lists as compatible google provider version >= 6.9.0, < 8, while at the same time referencing the module encryption_key (> 4.0). The module encryption_key (> 4.0) only allows for the google provider ">= 5.31.0, < 7" making it impossible to use with google ~>7.
The support for google ~> 7 is limited by the module encryption_key, and not terraform-google-cloud-storage directly. However, the allowed versions for the google provider should be changed accordingly I think. I lost some time locating where the constraint conflict came from.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions