mirror of
https://github.com/ysoftdevs/terraform-aws-eks.git
synced 2026-01-11 14:30:55 +01:00
fix: Avoid trying to attach the node role when Auto Mode nodepools are not specified (#3239)
This commit is contained in:
2
main.tf
2
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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user