运行 terraform plan 后出现以下错误。我尝试运行以下命令但没有帮助:
terraform init - upgrade
terraform init
terraform plan
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "=3.0.0"
}
}
}
# Configure the Microsoft Azure Provider
provider "azurerm" {
features {}
}
terraform plan
╷
│ Error: Failed to load plugin schemas
│
│ Error while loading schemas for plugin components: Failed to obtain provider schema: Could not load the schema for provider
│ registry.terraform.io/hashicorp/azurerm: failed to instantiate provider "registry.terraform.io/hashicorp/azurerm" to obtain schema:
│ fork/exec .terraform/providers/registry.terraform.io/hashicorp/azurerm/3.0.0/linux_amd64/terraform-provider-azurerm_v3.0.0_x5: exec
│ format error..
有一些建议删除 terraform 目录和锁定文件,但我找不到它。运行 terraform init 后看不到文件/文件夹。
最佳答案
一旦 terraform init
它将创建 terraformtfstate
文件、terraform.loc.hcl
文件以及提供程序的目录。
您可以在为 main.tf
文件创建的文件夹下获取这些文件..
关于azure - Terraform Azure - 加载插件组件的架构时出错 : Failed to obtain provider schema:,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72049954/