fix realestate-crawler: access nested notification_settings correctly

Vault KV stores notification_settings as nested JSON ({"slack":{"webhook_url":""}}).
TF code was passing the map object directly as a string env var value.
Fix: access ["slack"]["webhook_url"] with try() fallback.
This commit is contained in:
Viktor Barzin 2026-03-15 21:01:24 +00:00
parent 23dfaa1ac8
commit 2c8f3a607e

View file

@ -195,7 +195,7 @@ resource "kubernetes_deployment" "realestate-crawler-api" {
} }
env { env {
name = "SLACK_WEBHOOK_URL" name = "SLACK_WEBHOOK_URL"
value = local.notification_settings["slack"] value = local.notification_settings["slack"]["webhook_url"]
} }
env { env {
name = "WEBAUTHN_RP_ID" name = "WEBAUTHN_RP_ID"
@ -361,7 +361,7 @@ resource "kubernetes_deployment" "realestate-crawler-celery" {
} }
env { env {
name = "SLACK_WEBHOOK_URL" name = "SLACK_WEBHOOK_URL"
value = lookup(local.notification_settings, "slack", "") value = try(local.notification_settings["slack"]["webhook_url"], "")
} }
env { env {
name = "OSRM_FOOT_URL" name = "OSRM_FOOT_URL"
@ -472,7 +472,7 @@ resource "kubernetes_deployment" "realestate-crawler-celery-beat" {
} }
env { env {
name = "SCRAPE_SCHEDULES" name = "SCRAPE_SCHEDULES"
value = lookup(local.notification_settings, "scrape_schedules", "") value = try(tostring(local.notification_settings["scrape_schedules"]), "")
} }
volume_mount { volume_mount {
name = "data" name = "data"