From 67db2ba5ba9ceb6ec6d16fe93f6527286b1557f6 Mon Sep 17 00:00:00 2001 From: Jordan Conway Date: Wed, 30 Jul 2025 11:18:34 -0400 Subject: [PATCH 1/3] Try fixing incident.io integration with double jsonencode Signed-off-by: Jordan Conway --- integrations.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integrations.tf b/integrations.tf index 593a15c..b3d5a56 100644 --- a/integrations.tf +++ b/integrations.tf @@ -70,7 +70,7 @@ resource "datadog_webhook" "lf-incident-io" { event_type = "$EVENT_TYPE", hostname = "$HOSTNAME", last_updated = "$LAST_UPDATED", - logs_sample = "$LOGS_SAMPLE", + logs_sample = jsondecode("$LOGS_SAMPLE"), org = { id = "$ORG_ID", name = "$ORG_NAME" From 186b2fc082f4575bd1b4dc9e68cd41b2ca45d425 Mon Sep 17 00:00:00 2001 From: Jordan Conway Date: Wed, 30 Jul 2025 11:22:37 -0400 Subject: [PATCH 2/3] Use heredoc instead of jsonencode so that we can get LOG_SAMPLE properly Signed-off-by: Jordan Conway --- integrations.tf | 60 +++++++++++++++++++++++++------------------------ 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/integrations.tf b/integrations.tf index b3d5a56..9f91011 100644 --- a/integrations.tf +++ b/integrations.tf @@ -50,33 +50,35 @@ resource "datadog_webhook" "lf-incident-io" { encode_as = "json" custom_headers = jsonencode({ "Authorization" = "Bearer ${var.incident_io_bearer} " }) - payload = jsonencode({ - alert_transition = "$ALERT_TRANSITION", - deduplication_key = "$AGGREG_KEY-$ALERT_CYCLE_KEY", - title = "$EVENT_TITLE", - description = "$EVENT_MSG", - source_url = "$LINK", - metadata = { - id = "$ID", - alert_metric = "$ALERT_METRIC", - alert_query = "$ALERT_QUERY", - alert_scope = "$ALERT_SCOPE", - alert_status = "$ALERT_STATUS", - alert_title = "$ALERT_TITLE", - alert_type = "$ALERT_TYPE", - alert_url = "$LINK", - alert_priority = "$ALERT_PRIORITY", - date = "$DATE", - event_type = "$EVENT_TYPE", - hostname = "$HOSTNAME", - last_updated = "$LAST_UPDATED", - logs_sample = jsondecode("$LOGS_SAMPLE"), - org = { - id = "$ORG_ID", - name = "$ORG_NAME" - }, - snapshot_url = "$SNAPSHOT", - tags = "$TAGS" - } - }) + payload = <<-EOT +{ + "alert_transition": "$ALERT_TRANSITION", + "deduplication_key": "$AGGREG_KEY-$ALERT_CYCLE_KEY", + "title": "$EVENT_TITLE", + "description": "$EVENT_MSG", + "source_url": "$LINK", + "metadata": { + "id": "$ID", + "alert_metric": "$ALERT_METRIC", + "alert_query": "$ALERT_QUERY", + "alert_scope": "$ALERT_SCOPE", + "alert_status": "$ALERT_STATUS", + "alert_title": "$ALERT_TITLE", + "alert_type": "$ALERT_TYPE", + "alert_url": "$LINK", + "alert_priority": "$ALERT_PRIORITY", + "date": "$DATE", + "event_type": "$EVENT_TYPE", + "hostname": "$HOSTNAME", + "last_updated": "$LAST_UPDATED", + "logs_sample": $LOGS_SAMPLE, + "org": { + "id": "$ORG_ID", + "name": "$ORG_NAME" + }, + "snapshot_url": "$SNAPSHOT", + "tags": "$TAGS" + } +} +EOT } From 238fc41ffd7714a7f146beb1b9b3e32170494e6c Mon Sep 17 00:00:00 2001 From: Jordan Conway Date: Wed, 30 Jul 2025 11:25:54 -0400 Subject: [PATCH 3/3] Fix tofu fmt Signed-off-by: Jordan Conway --- integrations.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integrations.tf b/integrations.tf index 9f91011..e341b24 100644 --- a/integrations.tf +++ b/integrations.tf @@ -50,7 +50,7 @@ resource "datadog_webhook" "lf-incident-io" { encode_as = "json" custom_headers = jsonencode({ "Authorization" = "Bearer ${var.incident_io_bearer} " }) - payload = <<-EOT + payload = <<-EOT { "alert_transition": "$ALERT_TRANSITION", "deduplication_key": "$AGGREG_KEY-$ALERT_CYCLE_KEY",