azure - 安装 hashcorp/azurerm v2.73.0 时出错:打开
问题描述
使用 terraform v1.0.5的terraform init
命令失败并出现以下错误:
- Installing hashicorp/azurerm v2.73.0...
2021-09-02T17:53:54.661-0700 [TRACE] providercache.Dir.InstallPackage: installing registry.terraform.io/hashicorp/azurerm v2.73.0 from https://releases.hashicorp.com/terraform-provider-azurerm/2.73.0/terraform-provider-azurerm_2.73.0_windows_amd64.zip
2021-09-02T17:53:54.661-0700 [TRACE] HTTP client GET request to https://releases.hashicorp.com/terraform-provider-azurerm/2.73.0/terraform-provider-azurerm_2.73.0_windows_amd64.zip
2021-09-02T17:54:24.762-0700 [DEBUG] Provider signed by 34365D9472D7468F HashiCorp Security (hashicorp.com/security) <security@hashicorp.com>
╷
│ Error: Failed to install provider
│
│ Error while installing hashicorp/azurerm v2.73.0: open
│ .terraform\providers\registry.terraform.io\hashicorp\azurerm\2.73.0\windows_amd64\terraform-provider-azurerm_v2.73.0_x5.exe: The system cannot find the path
│ specified.
╵
我们删除了所有无关的 terraform 代码以将问题隔离到简单的提供程序配置。
触发此错误的最小示例的完整代码包括模块定义和对该模块定义的调用。
对模块定义的最小调用的完整代码是:
module "name-of-module" {
source = "..\\..\\..\\..\\modules\\name-of-module"
subscriptionId = var.subscriptionId
tenantId = var.tenantId
clientId = var.clientId
clientSecret = var.clientSecret
resourceGroupName = var.resourceGroupName
pipeAzureRegion = var.resourceGroupRegion
}
##Input variables. The client referred to is an App Registration.
variable "subscriptionId" { }
variable "tenantId" { }
variable "clientId" { }
variable "clientSecret" { }
variable "resourceGroupName" { }
variable "resourceGroupRegion" { }
最小模块定义的完整代码是:
variable "subscriptionId" { }
variable "tenantId" { }
#The client referred to is an App Registration.
variable "clientId" { }
variable "clientSecret" { }
variable "resourceGroupName" { }
variable "pipeAzureRegion" { }
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "=2.73.0"
}
}
}
provider "azurerm" {
subscription_id = var.subscriptionId
client_id = var.clientId
client_secret = var.clientSecret
tenant_id = var.tenantId
features { }
}
那是 100% 的代码。我们删除了所有其他内容以隔离问题的可能原因。
是什么导致我们在上面发布的错误消息?
解决方案
推荐阅读
- android - DatabaseReference 'setValue' Android Studio 显示错误
- android - 收到错误 android.util.SuperNotCalledException: Activity {} 没有调用 super.onCreate()
- asp.net - 文本未在材料 UI 核心中选择下拉列表的中心垂直对齐
- python - 如何调整我的神经网络以避免过度拟合 mnist 数据集?
- r - 如何分别标记所有组记录?
- python - Pygame 错误,音乐无法正常播放,因为它只是循环开始部分
- ruby-on-rails - 在 Rails 配置中获取 Rack/Puma 选项
- javascript - 在 laravel 中使用 ajax 上传文件
- azure - 使用 Function App 的 MSI 连接到主题
- javascript - 如何解决这个 Javascript/CSS 问题?