我在 Google Cloud 上部署 terraform 时遇到问题。
这是我的 terraform 文件。
terraform {
required_providers {
google = {
source = "hashicorp/google"
version = "5.24.0"
}
}
backend "local" {
path = "tf.tfstate"
}
}
provider "google" {
project = "tayarim-project"
region = "europe-west1"
}
resource "google_storage_bucket" "tayarim_s3" {
name = "NAME"
location = "EU"
}
resource "google_container_registry" "tayarim_regitstry" {
location = "EU"
}
我运行命令
terraform plan
一切似乎都是对的,当我跑步时terraform apply
我收到此错误:
Error: Provider produced inconsistent result after apply
│
│ When applying changes to google_container_registry.tayarim_regitstry, provider "provider[\"registry.terraform.io/hashicorp/google\"]" produced an unexpected new value: Root object was present, but now absent.
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
╵
我尝试更改提供程序版本,但这不起作用。
当插件提供程序在输入期间将值分配给表示资源的数据结构的属性/字段成员,但在状态输出分配期间未能这样做(可能是通过缺少字段)时,通常会发生这种情况。对于
google
来说,发生这种情况会很奇怪,因为它通常在例行验收测试期间很容易观察到,但实际上您应该将其报告给问题跟踪器,因为您无法解决此问题(除了更新到您声称已经尝试过的较新版本)。