From 2aa54e65ef7472e3e8aca90222da41cfe086c1ba Mon Sep 17 00:00:00 2001 From: Anton Babenko Date: Thu, 15 Apr 2021 09:08:19 +0200 Subject: [PATCH] fix: Empty target group attachments for Terraform 0.13 --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 206ddd0..e85ecec 100644 --- a/main.tf +++ b/main.tf @@ -128,7 +128,7 @@ locals { } resource "aws_lb_target_group_attachment" "this" { - for_each = local.target_group_attachments + for_each = var.create_lb && local.target_group_attachments != null ? local.target_group_attachments : {} target_group_arn = aws_lb_target_group.main[each.value.tg_index].arn target_id = each.value.target_id