From 2d92906c54675b502d9bee7012f031db9f3e2943 Mon Sep 17 00:00:00 2001 From: Scott Guymer Date: Mon, 25 Apr 2022 13:59:19 +0200 Subject: [PATCH] fix: Outputs for pool need to account for complexity (#1970) * fix: outputs for pool need to account for complexity As the pool is optional the output needs to take this into account and access the first instance in the list. We also must output null if not set. * Ensure pool role is output from main module --- modules/runners/outputs.tf | 2 +- outputs.tf | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/runners/outputs.tf b/modules/runners/outputs.tf index 9fa3223321..21354ce02a 100644 --- a/modules/runners/outputs.tf +++ b/modules/runners/outputs.tf @@ -23,5 +23,5 @@ output "role_scale_down" { } output "role_pool" { - value = length(var.pool_config) == 0 ? {} : module.pool.role_pool + value = length(var.pool_config) == 0 ? null : module.pool[0].role_pool } diff --git a/outputs.tf b/outputs.tf index eab083e259..d72f9acc93 100644 --- a/outputs.tf +++ b/outputs.tf @@ -9,6 +9,7 @@ output "runners" { role_runner = module.runners.role_runner role_scale_up = module.runners.role_scale_up role_scale_down = module.runners.role_scale_down + role_pool = module.runners.role_pool } }