From 12f4f3a605689cfa8f0192179aea23b2ea73a446 Mon Sep 17 00:00:00 2001 From: Tibo Beijen Date: Mon, 2 Dec 2019 16:30:00 +0100 Subject: [PATCH] Fixed references to aws_eks_cluster.this[0] that would raise errors when setting create_eks to false whilst having launch templates or launch configurations configured. --- data.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data.tf b/data.tf index b58be2a3..f43ac9e6 100644 --- a/data.tf +++ b/data.tf @@ -108,7 +108,7 @@ EOF } data "template_file" "userdata" { - count = local.worker_group_count + count = var.create_eks ? local.worker_group_count : 0 template = lookup( var.worker_groups[count.index], "userdata_template_file", @@ -154,7 +154,7 @@ data "template_file" "userdata" { } data "template_file" "launch_template_userdata" { - count = local.worker_group_launch_template_count + count = var.create_eks ? local.worker_group_launch_template_count : 0 template = lookup( var.worker_groups_launch_template[count.index], "userdata_template_file",