Terraform 您能否使属性不触发资源更改?

Terraform 您能否使属性不触发资源更改?,terraform,terraform-provider-gcp,Terraform,Terraform Provider Gcp,在Terraform中,是否有一种方法可以设置属性,使其不会触发资源更新 例如: resource "google_cloudfunctions_function" "sometimes_changes" { ... # label the function with timestamp - don't let this trigger an update. labels = { timestamp = timestamp } } 试试 试试 啊哈。很接近,但不是我

在Terraform中,是否有一种方法可以设置属性,使其不会触发资源更新

例如:

resource "google_cloudfunctions_function" "sometimes_changes" {
  ...

  # label the function with timestamp - don't let this trigger an update.

  labels = {
    timestamp = timestamp
  }
}
试试

试试


啊哈。很接近,但不是我想要的<代码>忽略\u更改导致在资源更新时完全忽略该字段。期望的行为是,只有在没有更新其他属性时才会忽略该属性。Aha。很接近,但不是我想要的<代码>忽略\u更改导致在资源更新时完全忽略该字段。期望的行为是,只有在没有更新其他属性时才忽略该属性。
resource "google_cloudfunctions_function" "sometimes_changes" {

...
    lifecycle {
        ignore_changes = [
          labels,
        ]
    }
}