++ fix inconsistent conditional result types in v2_source_ref_string
Some checks failed
Terraform Terragrunt (contour) / validate (push) Successful in 1m7s
Terraform Terragrunt (contour) / plan (push) Failing after 1m8s
Terraform Terragrunt (contour) / apply (push) Has been skipped

This commit is contained in:
Kochetkov S 2026-08-05 17:44:38 +03:00
parent ee8a64eb2e
commit 47852a2170

View File

@ -128,8 +128,12 @@ locals {
# secret_ref's ref is a plain "vault://path#field" string (unlike the other # secret_ref's ref is a plain "vault://path#field" string (unlike the other
# source kinds, whose ref is an object) - only meaningful for source_kind=secret_ref. # source kinds, whose ref is an object) - only meaningful for source_kind=secret_ref.
# source.ref is a string for secret_ref but an object for every other
# source.kind (postgresql_user/kafka_user/rabbitmq_user/s3_bucket/valkey_user)
# - HCL's conditional requires both branches to share a static type, so the
# object branch is forced through tostring()/try() to collapse to "".
v2_source_ref_string = { for secret in local.secrets_v2 : secret.id => v2_source_ref_string = { for secret in local.secrets_v2 : secret.id =>
local.v2_source_kind[secret.id] == "secret_ref" ? try(secret.source.ref, "") : "" local.v2_source_kind[secret.id] == "secret_ref" ? try(tostring(secret.source.ref), "") : ""
} }
v2_extra_fields = { for secret in local.secrets_v2 : secret.id => { v2_extra_fields = { for secret in local.secrets_v2 : secret.id => {