您可以使属性不触发资源更改吗?

时间:2020-01-23 17:27:07

标签: 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
  }
}

1 个答案:

答案 0 :(得分:0)

尝试ignore_changes block:

resource "google_cloudfunctions_function" "sometimes_changes" {

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