Skip to content

Commit e3243b7

Browse files
authored
Merge pull request #177 from ederst/fix-broken-workspace-inheritance
Fix configuration module inheritance #176
2 parents 351e513 + 482c5c9 commit e3243b7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

common/configuration/outputs.tf

+5-3
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,17 @@ locals {
33
(var.base_key) = var.configuration[var.base_key]
44
}
55

6+
base_config = local.base[var.base_key]
7+
68
overlays = {
79
# include all envs but the base_key in overlays
810
for env_key, env in var.configuration :
911
env_key => {
10-
# loop through all config keys in base_key environment
12+
# loop through all config keys in base_key environment and current env
1113
# if current env has that key, use the value from current env
1214
# if not, use the value from the base_key environment
13-
for key, value in var.configuration[var.base_key] :
14-
key => lookup(env, key, null) != null ? env[key] : value
15+
for key in setunion(keys(env), keys(local.base_config)) :
16+
key => lookup(env, key, null) != null ? env[key] : local.base_config[key]
1517
}
1618
if env_key != var.base_key
1719
}

0 commit comments

Comments
 (0)