From 06a5598210e98f036593f97f74488aae1cf179da Mon Sep 17 00:00:00 2001 From: Trevor Wood Date: Thu, 30 Sep 2021 07:40:22 -0400 Subject: [PATCH] fix: use dynamic block to ignore null market opts (#1202) Signed-off-by: Trevor Wood --- modules/runners/main.tf | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/runners/main.tf b/modules/runners/main.tf index ca00ec0f2e..dc8694b773 100644 --- a/modules/runners/main.tf +++ b/modules/runners/main.tf @@ -63,8 +63,12 @@ resource "aws_launch_template" "runner" { instance_initiated_shutdown_behavior = "terminate" - instance_market_options { - market_type = var.market_options + dynamic "instance_market_options" { + for_each = var.market_options != null ? [var.market_options] : [] + + content { + market_type = instance_market_options.value + } } image_id = data.aws_ami.runner.id