描述: 我正在尝试为 Terraform 使用 Elasticsearch 提供程序。由于没有来自 Elastic 或 Hashicorp 的官方版本,我正在尝试使用社区版本“https://registry.terraform.io/providers/phillbaker/elasticsearch/latest”。
Terraform 版本: Terraform v0.14.4
代码:
我试图将所有内容放入 1 个 .tf 文件中。我还尝试为 Hashicorp 推荐的资源创建一个单独的模块。两种方法都会生成相同的错误消息。
terraform {
required_providers {
elk = {
source = "phillbaker/elasticsearch"
version = "1.5.1"
}
}
}
provider "elk" {
url = "https://<my_elk_server>"
}
resource "elasticsearch_index" "index" {
name = var.elasticsearch_index_name
}
问题:
terraform init
由于某种原因,无法在 Terraform Registry 中找到合适的提供程序。
Initializing the backend...
Initializing provider plugins...
- Finding latest version of hashicorp/elasticsearch...
- Finding phillbaker/elasticsearch versions matching "1.5.1"...
- Installing phillbaker/elasticsearch v1.5.1...
- Installed phillbaker/elasticsearch v1.5.1 (self-signed, key ID 02AD42CD82B6A957)
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:
Error: Failed to query available provider packages
https://www.terraform.io/docs/plugins/signing.html
Could not retrieve the list of available versions for provider
hashicorp/elasticsearch: provider registry registry.terraform.io does not have
a provider named registry.terraform.io/hashicorp/elasticsearch
If you have just upgraded directly from Terraform v0.12 to Terraform v0.14
then please upgrade to Terraform v0.13 first and follow the upgrade guide for
that release, which might help you address this problem.
没有生成 tfstate 文件。
如何使用 Terraform Registry 中的第三方提供商?