Skip to content

Commit 7a9b3b9

Browse files
committed
Add MZ_SYSTEM_PARAMETER_DEFAULT
1 parent 56709c4 commit 7a9b3b9

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

main.tf

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
locals {
22
name_prefix = "${var.namespace}-${var.environment}"
3+
4+
format_env_vars = { for idx, instance in var.instances : instance.name =>
5+
length(lookup(instance, "environmentd_extra_env", [])) > 0 ? [
6+
{
7+
name = "MZ_SYSTEM_PARAMETER_DEFAULT"
8+
value = join(";", [
9+
for item in instance.environmentd_extra_env :
10+
"${item.name}=${item.value}"
11+
])
12+
}
13+
] : null
14+
}
315
}
416

517
resource "kubernetes_namespace" "materialize" {
@@ -86,7 +98,7 @@ resource "kubernetes_manifest" "materialize_instances" {
8698
requestRollout = lookup(each.value, "request_rollout", null)
8799
forceRollout = lookup(each.value, "force_rollout", null)
88100

89-
environmentdExtraEnv = length(lookup(each.value, "environmentd_extra_env", [])) > 0 ? each.value.environmentd_extra_env : null
101+
environmentdExtraEnv = lookup(local.format_env_vars, each.key, null)
90102

91103
environmentdResourceRequirements = {
92104
limits = {

0 commit comments

Comments
 (0)