【发布时间】:2021-03-31 10:55:49
【问题描述】:
我正在尝试使用 terraform v0.14.3 部署一个 bitbucket 管道,以在谷歌云中创建资源。运行 terraform 命令后,管道失败并出现以下错误:
Error: Invalid legacy provider address
This configuration or its associated state refers to the unqualified provider
"google".
You must complete the Terraform 0.13 upgrade process before upgrading to later
versions.
我们将本地版本的 terraform 更新为 v.0.13.0,然后运行:terraform 0.13upgrade,如本指南中所述:https://www.terraform.io/upgrade-guides/0-13.html。生成了需要 terraform 版本 >=0.13 的 versions.tf 文件,我们所需的提供程序块现在如下所示:
terraform {
backend "gcs" {
bucket = "some-bucket"
prefix = "terraform/state"
credentials = "key.json" #this is just a bitbucket pipeline variable
}
required_providers {
google = {
source = "hashicorp/google"
version = "~> 2.20.0"
}
}
}
provider "google" {
project = var.project_ID
credentials = "key.json"
region = var.project_region
}
我们在启动 bitbucket 管道时仍然遇到同样的错误。有谁知道如何克服这个错误?提前致谢。
【问题讨论】:
标签: terraform bitbucket-pipelines terraform-provider-gcp