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:
parent
e9a14f7df9
commit
9ed19e1b42
1 changed files with 3 additions and 3 deletions
|
|
@ -195,7 +195,7 @@ resource "kubernetes_deployment" "realestate-crawler-api" {
|
|||
}
|
||||
env {
|
||||
name = "SLACK_WEBHOOK_URL"
|
||||
value = local.notification_settings["slack"]
|
||||
value = local.notification_settings["slack"]["webhook_url"]
|
||||
}
|
||||
env {
|
||||
name = "WEBAUTHN_RP_ID"
|
||||
|
|
@ -361,7 +361,7 @@ resource "kubernetes_deployment" "realestate-crawler-celery" {
|
|||
}
|
||||
env {
|
||||
name = "SLACK_WEBHOOK_URL"
|
||||
value = lookup(local.notification_settings, "slack", "")
|
||||
value = try(local.notification_settings["slack"]["webhook_url"], "")
|
||||
}
|
||||
env {
|
||||
name = "OSRM_FOOT_URL"
|
||||
|
|
@ -472,7 +472,7 @@ resource "kubernetes_deployment" "realestate-crawler-celery-beat" {
|
|||
}
|
||||
env {
|
||||
name = "SCRAPE_SCHEDULES"
|
||||
value = lookup(local.notification_settings, "scrape_schedules", "")
|
||||
value = try(tostring(local.notification_settings["scrape_schedules"]), "")
|
||||
}
|
||||
volume_mount {
|
||||
name = "data"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue