Skip to content

Commit 9fde29c

Browse files
authored
[eks/cluster] Bugfix: invalid count argument when creating new cluster (#1057)
1 parent b9380c1 commit 9fde29c

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

modules/eks/cluster/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## Release 1.455.1
2+
3+
Components PR [#1057](https://github.com/cloudposse/terraform-aws-components/pull/1057)
4+
5+
Fixed "Invalid count argument" argument when creating new cluster
6+
17
## Release 1.452.0
28

39
Components PR [#1046](https://github.com/cloudposse/terraform-aws-components/pull/1046)

modules/eks/cluster/main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ locals {
5555
# If Karpenter IAM role is enabled, give it access to the cluster to allow the nodes launched by Karpenter to join the EKS cluster
5656
karpenter_role_arn = one(aws_iam_role.karpenter[*].arn)
5757

58-
linux_worker_role_arns = compact(concat(
58+
linux_worker_role_arns = local.enabled ? concat(
5959
var.map_additional_worker_roles,
6060
# As of Karpenter v0.35.0, there is no entry in the official Karpenter documentation
6161
# stating how to configure Karpenter node roles via EKS Access Entries.
@@ -64,8 +64,8 @@ locals {
6464
# does not work if they are Windows nodes, but at the moment, this component
6565
# probably has other deficiencies that would prevent it from working with Windows nodes,
6666
# so we will stick with just saying Windows is not supported until we have some need for it.
67-
[local.karpenter_role_arn],
68-
))
67+
local.karpenter_iam_role_enabled ? [local.karpenter_role_arn] : [],
68+
) : []
6969

7070
# For backwards compatibility, we need to add the unmanaged worker role ARNs, but
7171
# historically we did not care whether they were LINUX or WINDOWS.

0 commit comments

Comments
 (0)