【问题标题】:Terraform tries to load old defunct providerTerraform 尝试加载旧的已失效提供程序
【发布时间】:2021-08-30 06:35:18
【问题描述】:

尝试使用 cyrilgdn/postgresql 提供程序,但 terraform 继续尝试加载 hashcorp/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

地形提供者报告

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

如何阻止它尝试查找 hashcorp/postgresql ?

【问题讨论】:

    标签: postgresql terraform amazon-rds hashicorp


    【解决方案1】:

    应该是postgresql,而不是postgres

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

    【讨论】:

      猜你喜欢
      • 2021-03-31
      • 1970-01-01
      • 2012-10-18
      • 2021-05-05
      • 2021-02-06
      • 2014-07-27
      • 2016-09-23
      • 2014-04-30
      相关资源
      最近更新 更多