File tree Expand file tree Collapse file tree 1 file changed +17
-9
lines changed Expand file tree Collapse file tree 1 file changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -3,17 +3,25 @@ locals {
3
3
aws_region = " eu-west-1"
4
4
5
5
# Load runner configurations from Yaml files
6
- multi_runner_config = {
6
+ multi_runner_config_files = {
7
7
for c in fileset (" ${ path . module } /templates/runner-configs" , " *.yaml" ) :
8
8
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
+ }
17
25
)
18
26
}
19
27
}
You can’t perform that action at this time.
0 commit comments