FAQ | This is a LIVE service | Changelog

CI changing webapp are not completely ignored by terraform

Ending up with a result like:

    ~ template {
          ~ metadata {
              ~ annotations = {
                    "autoscaling.knative.dev/maxScale"      = "20"
                  - "client.knative.dev/user-image"         = "eu.gcr.io/iar-devel-xxxxxxx/webapp:gitlab-ci-job-xxxxx" -> null
                  - "run.googleapis.com/client-name"        = "gcloud" -> null
                  - "run.googleapis.com/client-version"     = "286.0.0" -> null
                    "run.googleapis.com/cloudsql-instances" = "iar-devel-xxxxxxx:europe-west2:sql-xxxxxxx"
                }
                generation  = 0
                labels      = {}
              ~ name        = "webapp-00003-hir" -> "webapp-7c61c00a"
            }

According to ignore_changes documentation:

You can also ignore specific map elements by writing references like tags["Name"] in the ignore_changes list, though with an important caveat: the ignoring applies only to in-place updates to an existing key. Adding or removing a key is treated by Terraform as a change to the containing map itself rather than to the individual key, and so if you wish to ignore changes to a particular tag made by an external system you must ensure that the Terraform configuration creates a placeholder element for that tag name so that the external system changes will be understood as an in-place edit of that key