Skip to content

Commit ce34f1d

Browse files
authored
fix: Avoid trying to attach the node role when Auto Mode nodepools are not specified (#3239)
1 parent 5583604 commit ce34f1d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ resource "aws_eks_cluster" "this" {
5858
content {
5959
enabled = try(compute_config.value.enabled, null)
6060
node_pools = local.auto_mode_enabled ? try(compute_config.value.node_pools, []) : null
61-
node_role_arn = local.auto_mode_enabled ? try(compute_config.value.node_role_arn, aws_iam_role.eks_auto[0].arn, null) : null
61+
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
6262
}
6363
}
6464

0 commit comments

Comments
 (0)