azure - Terraform Azure - 加载插件组件的架构时出错 : Failed to obtain provider schema:

标签 azure terraform terraform-provider-azure

运行 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 后看不到文件/文件夹。

enter image description here

最佳答案

一旦 terraform init 它将创建 terraformtfstate 文件、terraform.loc.hcl 文件以及提供程序的目录。

您可以在为 main.tf 文件创建的文件夹下获取这些文件..

enter image description here

关于azure - Terraform Azure - 加载插件组件的架构时出错 : Failed to obtain provider schema:,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72049954/

相关文章:

c# - Microsoft Azure 中的 SQL 连接错误

javascript - Azure 移动服务 : Custom Authentication using Java script backend?

azure - 在 Terraform for Azure 中使用 for_each 时如何获取 id 作为输出?

azure - Terraform - 'Objects have changed outside of Terraform' 用于新的 Azure 资源组

Terraform 无法列出提供者

azure - 触发Azure容器实例组每天启动

postgresql - 在 Azure PostgreSQL 灵活服务器中恢复数据库时出错 : 'extension "azure"is not allow-listed'

authentication - Azure Multi-Tenancy 应用程序

docker - 带有 terraform 和 efs 的 AWS ECS 任务定义 - 未知卷

linux - 如何在 windows 10 linux 子系统上卸载 terraform 并安装更新版本的 terraform?