I am declaring a google_logging_metric
resource in Terraform (using version 0.11.14
)
I have the following declaration
resource "google_logging_metric" "my_metric" {
description = "Check for logs of some cron job\t"
name = "mycj-logs"
filter = "resource.type=\"k8s_container\" AND resource.labels.cluster_name=\"${local.k8s_name}\" AND resource.labels.namespace_name=\"workable\" AND resource.labels.container_name=\"mycontainer-cronjob\" \nresource.labels.pod_name:\"my-pod\""
project = "${data.terraform_remote_state.gke_k8s_env.project_id}"
metric_descriptor {
metric_kind = "DELTA"
value_type = "INT64"
}
}
Is there a way to make the filter
field multiline?
The existence of the local
variable "${local.k8s_name}
makes it a bit challenging.
terraform multiline string
– Dissension=\"${local.k8s_name}\"
is parsed appropriately – Electrodialysis