Skip to content

Commit 1a3cb87

Browse files
committed
fix: dependency resolution order
1 parent 7ae0a62 commit 1a3cb87

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

examples/multi-runner/main.tf

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,25 @@ locals {
33
aws_region = "eu-west-1"
44

55
# Load runner configurations from Yaml files
6-
multi_runner_config = {
6+
multi_runner_config_files = {
77
for c in fileset("${path.module}/templates/runner-configs", "*.yaml") :
88

9-
trimsuffix(c, ".yaml") => yamldecode(
10-
templatefile(
11-
"${path.module}/templates/runner-configs/${c}",
12-
{
13-
vpc_id = module.base_other.vpc.vpc_id
14-
subnet_ids = jsonencode(module.base_other.vpc.private_subnets)
15-
}
16-
)
9+
trimsuffix(c, ".yaml") => yamldecode(file("${path.module}/templates/runner-configs/${c}"))
10+
}
11+
multi_runner_config = {
12+
for k, v in local.multi_runner_config_files :
13+
14+
k => merge(
15+
v,
16+
{
17+
runner_config = merge(
18+
v.runner_config,
19+
{
20+
subnet_ids = lookup(v.runner_config, "subnet_ids", null) != null ? module.base_other.vpc.private_subnets : null
21+
vpc_id = lookup(v.runner_config, "vpc_id", null) != null ? module.base_other.vpc.vpc_id : null
22+
}
23+
)
24+
}
1725
)
1826
}
1927
}

0 commit comments

Comments
 (0)