From ce34f1db3f7824167d9a766e6c90dee3a6dcf1c3 Mon Sep 17 00:00:00 2001 From: Bryant Biggs Date: Thu, 12 Dec 2024 07:14:15 -0600 Subject: [PATCH] fix: Avoid trying to attach the node role when Auto Mode nodepools are not specified (#3239) --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 6c15ff9ff9..82b2fb190d 100644 --- a/main.tf +++ b/main.tf @@ -58,7 +58,7 @@ resource "aws_eks_cluster" "this" { content { enabled = try(compute_config.value.enabled, null) node_pools = local.auto_mode_enabled ? try(compute_config.value.node_pools, []) : null - node_role_arn = local.auto_mode_enabled ? try(compute_config.value.node_role_arn, aws_iam_role.eks_auto[0].arn, null) : null + node_role_arn = local.auto_mode_enabled && length(try(compute_config.value.node_pools, [])) > 0 ? try(compute_config.value.node_role_arn, aws_iam_role.eks_auto[0].arn, null) : null } }