Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.

Commit 1f0c938

Browse files
authored
fix(multi-runner): Fix runner_additional_security_group_ids (#3352)
If `runner_additional_security_group_ids` is only set outside the multi_runner_config `coalesce(each.value.runner_config.runner_additional_security_group_ids, var.runner_additional_security_group_ids)` is coalescing an empty list (the default value for `each.value.runner_config.runner_additional_security_group_ids`) with whatever is set outside the multi_runner_config, this always results in the returned value being an empty list: ``` > coalesce([], ["sg-123456"]) tolist([]) ``` Using coalescelist instead returns the first non-empty list: ``` > coalescelist([], ["sg-123456"]) [ "sg-123456", ] ``` And the `try` returns an empty list if both coalesced lists are empty (rather than throwing an error): ``` > try(coalescelist([], []), []) [] ```
1 parent 6d018f6 commit 1f0c938

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: modules/multi-runner/runners.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ module "runners" {
4949
idle_config = each.value.runner_config.idle_config
5050
enable_ssm_on_runners = each.value.runner_config.enable_ssm_on_runners
5151
egress_rules = var.runner_egress_rules
52-
runner_additional_security_group_ids = coalesce(each.value.runner_config.runner_additional_security_group_ids, var.runner_additional_security_group_ids)
52+
runner_additional_security_group_ids = try(coalescelist(each.value.runner_config.runner_additional_security_group_ids, var.runner_additional_security_group_ids), [])
5353
metadata_options = each.value.runner_config.runner_metadata_options
5454
credit_specification = each.value.runner_config.credit_specification
5555

0 commit comments

Comments
 (0)