Terraform 尝试加载旧的已失效提供程序

Terraform tries to load old defunct provider

正在尝试使用 cyrilgdn/postgresql 提供程序,但 terraform 继续尝试加载 hashicorp/postgresql,这会导致 init 失败。目前使用的是 terraform 1.0.0,虽然问题也发生在 14.1 上 - 还没有从 12.x 升级,总是 运行 14.1 或更新的这项工作。

我已将代码缩减为以下内容,此文件夹中没有其他内容,但问题仍然存在

terraform {
  required_version = ">= 0.14.1"

  required_providers {
    postgres = {
      source  = "cyrilgdn/postgresql"
      version = ">=1.13.0"
    }
  }
}

provider "postgresql" {
  host = "TBC"
  port = 5432
  username = "TBC"
  password = "TBC"
}

初始报告:

Initializing provider plugins...
- Finding cyrilgdn/postgresql versions matching ">= 1.13.0"...
- Finding latest version of hashicorp/postgresql...
- Installing cyrilgdn/postgresql v1.13.0...
- Installed cyrilgdn/postgresql v1.13.0 (self-signed, key ID 3918DD444A3876A6)

Partner and community providers are signed by their developers.
If you'd like to know more about provider signing, you can read about it here:

https://www.terraform.io/docs/cli/plugins/signing.html
Error: Failed to query available provider packages

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

terraform 提供商报告

Providers required by configuration:
.
├── provider[registry.terraform.io/hashicorp/postgresql]
└── provider[registry.terraform.io/cyrilgdn/postgresql] >= 1.13.0

我怎样才能阻止它试图找到 hashicorp/postgresql?

应该是postgresql,不是postgres

terraform {
  required_version = ">= 0.14.1"

  required_providers {
    postgresql = {
      source  = "cyrilgdn/postgresql"
      version = ">=1.13.0"
    }
  }
}