From e25ba404949a0d69f52e20401a06b097d91d60b5 Mon Sep 17 00:00:00 2001 From: janli Date: Tue, 19 Nov 2024 16:52:20 -0800 Subject: [PATCH] fix: fix escape --- common.tf | 4 ++-- templates/apiary-hms-readonly.json | 6 +++--- templates/apiary-hms-readwrite.json | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/common.tf b/common.tf index 34c398c..3b058cc 100644 --- a/common.tf +++ b/common.tf @@ -62,8 +62,8 @@ locals { ro_ingress_cidr = var.ingress_cidr rw_ingress_cidr = length(var.rw_ingress_cidr) == 0 ? var.ingress_cidr : var.rw_ingress_cidr - hms_metrics = join("\",\"", var.datadog_metrics_hms_readwrite_readonly) - hms_metrics_type_overrides = join("\": \"gauge\",\"", var.datadog_metrics_hms_readwrite_readonly) + hms_metrics = join("\\\",\\\"", var.datadog_metrics_hms_readwrite_readonly) + hms_metrics_type_overrides = join("\\\": \\\"gauge\\\",\\\"", var.datadog_metrics_hms_readwrite_readonly) } data "aws_iam_account_alias" "current" {} diff --git a/templates/apiary-hms-readonly.json b/templates/apiary-hms-readonly.json index 1fc27cf..ea7a36b 100644 --- a/templates/apiary-hms-readonly.json +++ b/templates/apiary-hms-readonly.json @@ -75,9 +75,9 @@ } }, "dockerLabels": { - "com.datadoghq.ad.instances": '[{ "prometheus_url": "http://%%host%%:8080/actuator/prometheus", "namespace": "${hms_metrics_namespace}", "metrics": ["${hms_metrics}"],"type_overrides":{"${hms_metrics_type_overrides}": "gauge"} }]', - "com.datadoghq.ad.check_names": '["prometheus"]', - "com.datadoghq.ad.init_configs": '[{}]' + "com.datadoghq.ad.instances": "[{ \"prometheus_url\": \"http://%%host%%:8080/actuator/prometheus\", \"namespace\": \"${hms_metrics_namespace}\", \"metrics\": [\"${hms_metrics}\"],\"type_overrides\":{\"${hms_metrics_type_overrides}\": \"gauge\"} }]", + "com.datadoghq.ad.check_names": "[\"prometheus\"]", + "com.datadoghq.ad.init_configs": "[{}]" }, "portMappings": [ { diff --git a/templates/apiary-hms-readwrite.json b/templates/apiary-hms-readwrite.json index b215367..64220d2 100644 --- a/templates/apiary-hms-readwrite.json +++ b/templates/apiary-hms-readwrite.json @@ -75,9 +75,9 @@ } }, "dockerLabels": { - "com.datadoghq.ad.instances": '[{ "prometheus_url": "http://%%host%%:8080/actuator/prometheus", "namespace": "${hms_metrics_namespace}", "metrics": ["${hms_metrics}"],"type_overrides":{"${hms_metrics_type_overrides}": "gauge"} }]', - "com.datadoghq.ad.check_names": '["prometheus"]', - "com.datadoghq.ad.init_configs": '[{}]' + "com.datadoghq.ad.instances": "[{ \"prometheus_url\": \"http://%%host%%:8080/actuator/prometheus\", \"namespace\": \"${hms_metrics_namespace}\", \"metrics\": [\"${hms_metrics}\"],\"type_overrides\":{\"${hms_metrics_type_overrides}\": \"gauge\"} }]", + "com.datadoghq.ad.check_names": "[\"prometheus\"]", + "com.datadoghq.ad.init_configs": "[{}]" }, "portMappings": [ {