Skip to content

Commit

Permalink
fix: Avoid trying to attach the node role when Auto Mode nodepools ar…
Browse files Browse the repository at this point in the history
…e not specified (terraform-aws-modules#3239)
  • Loading branch information
bryantbiggs authored Dec 12, 2024
1 parent 5583604 commit ce34f1d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down

0 comments on commit ce34f1d

Please sign in to comment.