terraform-aws-modules/terraform-aws-kms

key_pair module reports incorrect latest version

vstthomas opened this issue · 6 comments

Description

The terraform init process errors with The newest available version is 2.0.3; according to the releases, the latest version is 2.2.1.

% make init
terraform init -get=true -backend=true -reconfigure

Initializing the backend...

Successfully configured the backend "s3"! Terraform will automatically
use this backend unless the backend configuration changes.
Initializing modules...
╷
│ Error: Unresolvable module version constraint
│ 
│   on key-pair.tf line 9:
│    9: module "key_pair" {
│ 
│ There is no available version of module "registry.terraform.io/terraform-aws-modules/key-pair/aws" (key-pair.tf:9) which matches the given version constraint. The newest available version is 2.0.3.
╵
  • ✋ I have searched the open/closed issues and my issue is not listed.

Versions

module "key_pair" {
  source  = "terraform-aws-modules/key-pair/aws"
  version = "~> 2.2.1"
...
}
  • Terraform version:

% tf version
Terraform v1.7.5
on darwin_arm64

  • Provider version(s):
  • provider registry.terraform.io/hashicorp/aws v5.47.0
  • provider registry.terraform.io/hashicorp/cloudinit v2.3.4
  • provider registry.terraform.io/hashicorp/helm v2.13.1
  • provider registry.terraform.io/hashicorp/kubernetes v2.29.0
  • provider registry.terraform.io/hashicorp/null v3.2.2
  • provider registry.terraform.io/hashicorp/time v0.11.1
  • provider registry.terraform.io/hashicorp/tls v4.0.5

Reproduction Code [Required]

Steps to reproduce the behavior:
Workspaces: no
Clear Cache: yes

Steps to Reproduce

  1. Create module like
module "key_pair" {
  source  = "terraform-aws-modules/key-pair/aws"
  version = "~> 2.2.1"

  key_name_prefix    = local.name
  create_private_key = true

  tags = local.tags
}
  1. terraform init
  2. ERROR

The newest available version is 2.0.3.

Expected behavior

The module initializes.

Actual behavior

The module failed init for the version number.

If using a lock file you'll need to use -upgrade

module "key_pair" {
  source  = "terraform-aws-modules/key-pair/aws"
  version = "~> 2.2.1"  # 2.0.3 does not satisfy this condition
...
}

You should use version = "~> 2.0" or similar.

@bryantbiggs Good tips, thank you. I did not have -upgrade in there; that helped.

@antonbabenko, updated the version to reflect suggested. But, version = "~> 2.0" doesn't get me to 2.2.1.
In this case, I've upgraded all modules (using the same method) but only the key_pair errors; not sure why the others worked without it then 🤔

Any ideas?

There is no module terraform-aws-modules/key-pair/aws with version 2.2.1 (only 2.0.3 - https://registry.terraform.io/modules/terraform-aws-modules/key-pair/aws/latest )

The link was miss-documented in the code 😞 it's always the details ☕ ☕ ☕

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.