Skip to content

Commit adb47f4

Browse files
aamoctzbryantbiggs
andauthored
feat: Add node_iam_role_arns local variable to check for Windows platform on EKS managed nodegroups (#2477)
Update node_iam_role_arns locals to check for Windows Managed Node Groups Co-authored-by: Bryant Biggs <[email protected]>
1 parent d4e6c15 commit adb47f4

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ locals {
469469
node_iam_role_arns_non_windows = distinct(
470470
compact(
471471
concat(
472-
[for group in module.eks_managed_node_group : group.iam_role_arn],
472+
[for group in module.eks_managed_node_group : group.iam_role_arn if group.platform != "windows"],
473473
[for group in module.self_managed_node_group : group.iam_role_arn if group.platform != "windows"],
474474
var.aws_auth_node_iam_role_arns_non_windows,
475475
)
@@ -479,6 +479,7 @@ locals {
479479
node_iam_role_arns_windows = distinct(
480480
compact(
481481
concat(
482+
[for group in module.eks_managed_node_group : group.iam_role_arn if group.platform == "windows"],
482483
[for group in module.self_managed_node_group : group.iam_role_arn if group.platform == "windows"],
483484
var.aws_auth_node_iam_role_arns_windows,
484485
)

modules/eks-managed-node-group/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,4 +193,5 @@ module "eks_managed_node_group" {
193193
| <a name="output_node_group_resources"></a> [node\_group\_resources](#output\_node\_group\_resources) | List of objects containing information about underlying resources |
194194
| <a name="output_node_group_status"></a> [node\_group\_status](#output\_node\_group\_status) | Status of the EKS Node Group |
195195
| <a name="output_node_group_taints"></a> [node\_group\_taints](#output\_node\_group\_taints) | List of objects containing information about taints applied to the node group |
196+
| <a name="output_platform"></a> [platform](#output\_platform) | Identifies if the OS platform is `bottlerocket`, `linux`, or `windows` based |
196197
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

modules/eks-managed-node-group/outputs.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,12 @@ output "iam_role_unique_id" {
8888
description = "Stable and unique string identifying the IAM role"
8989
value = try(aws_iam_role.this[0].unique_id, null)
9090
}
91+
92+
################################################################################
93+
# Additional
94+
################################################################################
95+
96+
output "platform" {
97+
description = "Identifies if the OS platform is `bottlerocket`, `linux`, or `windows` based"
98+
value = var.platform
99+
}

0 commit comments

Comments
 (0)