Hal*_*lil 3 amazon-web-services terraform infrastructure-as-code
我正在尝试更新 hashcorp/aws 提供商版本。
我添加了包含以下内容的 terraform.tf 文件:
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.0"
}
}
}
Run Code Online (Sandbox Code Playgroud)
后来我尝试使用以下方法更新模块:
terraform init -upgrade
Run Code Online (Sandbox Code Playgroud)
然而,我已经开始明白:
Could not retrieve the list of available versions for provider hashicorp/aws: no available releases match the given constraints >= 2.0.0, ~> 3.27, ~> 4.0
Run Code Online (Sandbox Code Playgroud)
如何解决这个问题呢?
Hal*_*lil 10
这是错误消息的重要部分。
\n>= 2.0.0, ~> 3.27, ~> 4.0\nRun Code Online (Sandbox Code Playgroud)\n2和3不可能同时出现。
\n这种特定情况的解决方案是停止同时请求 2 个不同的版本。
\n检查可用提供程序的版本:
\n!+?main ~/Projects/x/src/x-devops/terraform/env/test> terraform providers\n\nProviders required by configuration:\n.\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 module.test-sonar\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 provider[registry.terraform.io/hashicorp/aws]\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 module.client_vpn\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 provider[registry.terraform.io/hashicorp/aws]\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 module.test-appserver\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 provider[registry.terraform.io/hashicorp/aws] ~> 3.27\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 module.test-vpn-server\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 provider[registry.terraform.io/hashicorp/aws]\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 module.test-networking\n...\nRun Code Online (Sandbox Code Playgroud)\n有一个模块要求3.27.
找到所有请求 3.27 的模块并将其更新为 4.0。
\n这应该可以解决此类问题。
\n| 归档时间: |
|
| 查看次数: |
7631 次 |
| 最近记录: |