gpt4 book ai didi

azure - 错误: Failed to query available provider packages

转载 作者:行者123 更新时间:2023-12-03 06:16:16 26 4
gpt4 key购买 nike

我正在尝试使用 terraform(版本:1.4.6)运行 AKS,当我执行“terraform init”时遇到问题,下面是引用的屏幕截图。如果有人知道请帮忙。

模块:AKS、KeyVault、服务主体

enter image description here

enter image description here

最佳答案

您正在定义required_providers block以错误的方式。这:

terraform {

required_providers {
azuread = "~> 2.9.0"
random = "~> 3.1"
azurerm = "~> 3.0.0"

}
}

必须重写。您必须使用 documentation 中定义的正确语法。 。所以这会是这样的:

terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~> 3.0"
}
azuread = {
source = "hashicorp/azuread"
version = "~> 2.0"
}
}
}

您不必像这样定义random 提供程序。运行 terraform init 按预期工作:

terraform init           
Initializing modules...

Initializing the backend...

Initializing provider plugins...
- Finding hashicorp/azuread versions matching "~> 2.0"...
- Finding hashicorp/azurerm versions matching "~> 3.0"...
- Installing hashicorp/azurerm v3.55.0...
- Installed hashicorp/azurerm v3.55.0 (signed by HashiCorp)
- Installing hashicorp/azuread v2.38.0...
- Installed hashicorp/azuread v2.38.0 (signed by HashiCorp)

Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.

关于azure - 错误: Failed to query available provider packages,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/76227523/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com