terraform init vsphere provider - 无法查询可用的提供程序包 vmsphere

terraform init vsphere provider - Failed to query available provider packages vmsphere

terraform v1.0.3 通过 brew 安装在 Mac OS

这是我第一次将 Terraform 与“vshpere”提供程序一起使用。当我对我的计划执行 terraform init 时,出现以下错误。

provider "vsphere" {
  user           = var.vsphere_user
  password       = var.vsphere_password
  vsphere_server = var.vsphere_server
}

module "exa_v30_01" {
  source           = "../modules/vm"
  vsphere_user     = var.vsphere_user
  vsphere_password = var.vsphere_password
  template_name    = var.template_name
  vm_name          = var.vm_name
}

$ terraform init
Initializing modules...

Initializing the backend...

Initializing provider plugins...
- Finding latest version of hashicorp/vsphere...
- Finding latest version of hashicorp/vmsphere...
- Installing hashicorp/vsphere v2.0.2...
- Installed hashicorp/vsphere v2.0.2 (signed by HashiCorp)
╷
│ Error: Failed to query available provider packages
│ 
│ Could not retrieve the list of available versions for provider
│ hashicorp/vmsphere: provider registry registry.terraform.io does
│ not have a provider named registry.terraform.io/hashicorp/vmsphere
│ 
│ All modules should specify their required_providers so that
│ external consumers will get the correct providers when using a
│ module. To see which modules are currently depending on
│ hashicorp/vmsphere, run the following command:
│     terraform providers
╵

$ terraform providers

Providers required by configuration:
.
├── provider[registry.terraform.io/hashicorp/vsphere]
└── module.exa_v30_01
    ├── provider[registry.terraform.io/hashicorp/vsphere]
    └── provider[registry.terraform.io/hashicorp/vmsphere]

我该如何解决这个问题?我在这里用谷歌搜索,但没有与 VSphpere 相关的内容。有什么线索吗?谢谢

更新:

我看到了 ,但那是为了 terraform 版本升级。

错误信息正确。有 不是提供商 称为 vmsphere。也许你想要 vsphere 供应商?您的模块 exa_v30_01 似乎在某处使用了错误的提供程序。