You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
terraform {
required_providers {
aws = {
source ="hashicorp/aws"
version ="~> 4.0"
}
}
}
provider"aws" {
region ="us-west-2"
}
provider"aws" {
alias ="global_region"
region ="us-east-1"
}
module"tf_next" {
source ="milliHQ/next-js/aws"
version ="~> 1.0.0-canary.2"
providers = {
aws.global_region = aws.global_region
}
}
Expected Behavior
When running terraform init the latest prerelease version of the module (1.0.0-canary.4) should be installed.
Actual Behavior
Initialization failed with the following error message:
Initializing modules...
╷
│ Error: Unresolvable module version constraint
│
│ There is no available version of module "registry.terraform.io/milliHQ/next-js/aws"
│ (main.tf:22) which matches the given version constraint. The newest available version
│ is 0.13.2.
Steps to Reproduce
terraform init
Additional Context
We currently publish prerelease versions in the semver version format v1.0.0-canary.x for our module Terraform Next.js for AWS to the public Terraform registry.
While in the prerelease phase we want to give our users the possibility to try out the new version.
We want to update the examples with a version constraint that always installs the latest available prerelease (e.g. ~> 1.0.0-canary.2).
The only other working solution is to use exact version numbers (e.g. 1.0.0-canary.4) in the examples, but this would mean that we have to update the version number in all of our examples for each new prerelease.
Because pre-release tags do not necessarily follow the normal semver order semantics, and one usually does not desire any pre-releases to be included in a range of semantic versions, they must only be defined with an exact version constraint. You can find this documented under Version Constraint Behavior.
We use GitHub issues for tracking bugs and enhancements, rather than for questions. While we can sometimes help with certain simple problems here, it's better to use the community forum where there are more people ready to help.
@jbardin Thanks for taking the time for the detailed response.
Yes, read over the part that says:
A prerelease version can be selected only by an exact version constraint.
So everything works as it should be from the definition.
What I instead want is that Terraform fully adapts Semver versioning, which is already covered in #17994.
Thanks for clarifying and sorry for the false bug report here.
crw
added
duplicate
issue closed because another issue already tracks this problem
and removed
new
new issue not yet triaged
labels
Jun 22, 2022
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.
Terraform Version
Terraform Configuration Files
Expected Behavior
When running
terraform init
the latest prerelease version of the module (1.0.0-canary.4
) should be installed.Actual Behavior
Initialization failed with the following error message:
Steps to Reproduce
terraform init
Additional Context
We currently publish prerelease versions in the semver version format
v1.0.0-canary.x
for our module Terraform Next.js for AWS to the public Terraform registry.While in the prerelease phase we want to give our users the possibility to try out the new version.
We want to update the examples with a version constraint that always installs the latest available prerelease (e.g.
~> 1.0.0-canary.2
).The only other working solution is to use exact version numbers (e.g.
1.0.0-canary.4
) in the examples, but this would mean that we have to update the version number in all of our examples for each new prerelease.References
required_version
: Terraform doesn't understand pre-release required_version constraint #28148The text was updated successfully, but these errors were encountered: