gpt4 book ai didi

azure - 无法查询可用的提供商包

转载 作者:行者123 更新时间:2023-12-03 04:48:04 28 4
gpt4 key购买 nike

我在 Azure 门户中使用 Powershell。Terraform 版本 = v1.0.3Powershell 版本 = 7.1.3

这是我的代码

provider "azurerm" {  
features {}
}
resource "azure_storage_account" "lab" {
name = "newbloddystoragegroup"
resource_group_name = "TFResourcegroup"
location = "eastus"
account_tier = "Standard"
account_replication_type = "LRS"
}
resource "azure_storage_container" "lab" {
name = "blobcontainer4dev"
storage_account_name = azure.storage.account.lab.name
container_access_type = "private"
}
resource "azure_storage_blob" "lab" {
name = "TerraformdevBlob"
storage_account_name = azure_storage_account.lab.name
storage_container_name = azure_storage_container.lab.name
account_replication_type = "Block"
}
resource "azure_storage_share" "lab"{
name = "terraformdevshare"
storage_account_name = azure_storage_account.lab.name
quota = 50
}

但是当我运行 terraform init 时..我收到以下错误

Initializing provider plugins...
- Finding latest version of hashicorp/azurerm...
- Finding latest version of hashicorp/azure...
- Installing hashicorp/azurerm v2.74.0...
- Installed hashicorp/azurerm v2.74.0 (signed by HashiCorp)

│ Error: Failed to query available provider packages

│ Could not retrieve the list of available versions for provider hashicorp/azure: provider registry registry.terraform.io does not have a provider named registry.terraform.io/hashicorp/azure

│ Did you intend to use terraform-providers/azure? If so, you must specify that source address in each module which requires that provider. To see which modules are currently depending on hashicorp/azure, run the following command:
│ terraform providers

我已经运行了这个..

terraform providers

Providers required by configuration:
.
├── provider[registry.terraform.io/hashicorp/azure]
└── provider[registry.terraform.io/hashicorp/azurerm]

但我不知道我必须改变什么

我尝试过...

  1. 我已经放了
provider "azurerm" {  
features {}
}

进入它自己的provider.tf文件...但我仍然收到错误

  • 我尝试过
  • provider "registry.terraform.io/hashicorp/azurerm" {  
    features {}
    }

    ...但事实证明这是 Not Acceptable 语法

  • 我尝试过更换
  • provider "azurerm" {  
    features {}
    }

    required_providers {
    azurerm = {
    source = "hashicorp/azurerm"
    version = "2.74.0"
    }

    ..但这也不起作用

    ..非常感谢任何帮助...只需指导我..您不一定需要告诉我答案

    最佳答案

    我相信您收到此错误是因为您使用了 azure_* 资源

    如果您打开Azure Provider在文档中,您会发现所有资源名称都以 azurerm_* 前缀开头。

    关于azure - 无法查询可用的提供商包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68965414/

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