TerraForm尝试加载已停用的旧提供程序 [英] Terraform tries to load old defunct provider

查看:8
本文介绍了TerraForm尝试加载已停用的旧提供程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试使用cyrilgdn/PostgreSQL提供程序,但Terraform继续尝试加载hashicorp/PostgreSQL,这会导致初始化失败。当前使用的是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 Provider报告

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"
    }
  }
}

这篇关于TerraForm尝试加载已停用的旧提供程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆