我使用的是terraform码头映像hashicorp/terraform:latest
,我在main.tf中将提供程序定义为:
terraform {
required_providers {
gitlab = {
source = "gitlabhq/gitlab"
version = "3.3.0"
}
}
}
provider "gitlab" {
token = var.gitlab_token
}
当我运行terraform时,会得到以下错误:
Initializing provider plugins...
- Finding gitlabhq/gitlab versions matching "3.3.0"...
- Finding latest version of hashicorp/aws...
- Finding latest version of hashicorp/gitlab...
- Installing gitlabhq/gitlab v3.3.0...
- Installed gitlabhq/gitlab v3.3.0 (signed by a HashiCorp partner, key ID BC097C3333027B14)
- Installing hashicorp/aws v3.22.0...
- Installed hashicorp/aws v3.22.0 (signed by HashiCorp)
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/plugins/signing.html
Error: Failed to query available provider packages
Could not retrieve the list of available versions for provider
hashicorp/gitlab: provider registry registry.terraform.io does not have a
provider named registry.terraform.io/hashicorp/gitlab
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.
Did you intend to use gitlabhq/gitlab? If so, you must specify that source
address in each module which requires that provider. To see which modules are
currently depending on hashicorp/gitlab, run the following command:
terraform providers
我无法从文档中找到这个问题的解决方案。有什么建议吗?
terraform -版本Terraform v0.14.3
发布于 2020-12-22 04:26:23
GitHub是提供者之一,尚未包括在Terraform注册表中 -参见文档的这种差异。这似乎是一种临时情况:
以下提供程序将很快在Terraform上发布,但还没有完全准备好。在它们发布之前,它们的文档可以在下面的链接中获得:
我无法从发布说明中判断这是否仅在0.14.x中,但我可以确认“旧”(即编写本报告时的当前) github提供程序与0.12.x一起工作。
https://devops.stackexchange.com/questions/13014
复制相似问题