[英]Terraform provider restrictions
I'm encountering problems when trying to run terraform init -upgrade
:我在尝试运行terraform init -upgrade
时遇到问题:
╷
│ Error: Failed to query available provider packages
│
│ Could not retrieve the list of available versions for provider hashicorp/aws: no available releases match the given constraints >= 2.23.0, >= 2.46.0, >= 3.0.0, >=
│ 3.62.0, >= 3.69.0, ~> 3.69, >= 3.72.0, >= 4.0.0, >= 4.5.0, 4.5.0
I was able to run a similar setup with terraform version 3.74 in my main manifest before but I upgraded some modules and as far as I can see the current min version is 4.5.0 so I switched to that.我之前能够在我的主清单中使用 terraform 版本 3.74 运行类似的设置,但我升级了一些模块,据我所知,当前的最低版本是 4.5.0,所以我切换到那个。 I'm unsure if the current problem is caused by the我不确定当前的问题是否由
~> 3.69
from one of my included modules or if I'm missing something else.来自我包含的模块之一,或者如果我遗漏了其他东西。
My current provider configuration is the following:我当前的提供商配置如下:
terraform {
required_version = ">= 1.0"
required_providers {
aws = {
source = "hashicorp/aws"
version = "4.5.0"
}
}
}
I found some modules that use the ~> operator for their examples like:我发现一些模块使用 ~> 运算符作为它们的示例,例如:
./.terraform/modules/kubernetes_addon.velero_thanos_bucket/examples/notification/versions.tf: version = "~> 3.69"
./.terraform/modules/kubernetes_addon.velero_thanos_bucket/examples/object/versions.tf: version = "~> 3.69"
./.terraform/modules/s3_bucket_for_logs/examples/complete-legacy/versions.tf: version = "~> 3.69.0"
I'm already using the newest version of those modules and they have been working when I was enforcing version 3.74 in the required_providers
previously.我已经在使用这些模块的最新版本,并且当我之前在required_providers
中执行版本 3.74 时它们一直在工作。
~> is a very stringent constraint, and so is =
as you require above. ~>是一个非常严格的约束, =
也是如此,正如您上面所要求的那样。
= (or no operator): Allows only one exact version number. =(或无运算符):只允许一个确切的版本号。 Cannot be combined with other conditions.不能与其他条件结合。
~>: Allows only the rightmost version component to increment. ~>:只允许最右边的版本组件递增。 For example, to allow new patch releases within a specific minor release, use the full version number: ~> 1.0.4 will allow installation of 1.0.5 and 1.0.10 but not 1.1.0.例如,要允许在特定次要版本中发布新补丁,请使用完整版本号:~> 1.0.4 将允许安装 1.0.5 和 1.0.10,但不允许安装 1.1.0。 This is usually called the pessimistic constraint operator.这通常称为悲观约束算子。
Something can't both be exactly 4.5.0 and greater than 3.69 but less than 4.0.有些东西不能既正好是 4.5.0 又大于 3.69 但小于 4.0。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.