Skip to content

Commit

Permalink
feat: Add node_iam_role_arns local variable to check for Windows pl…
Browse files Browse the repository at this point in the history
…atform 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]>
  • Loading branch information
aamoctz and bryantbiggs authored Aug 3, 2023
1 parent d4e6c15 commit adb47f4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ locals {
node_iam_role_arns_non_windows = distinct(
compact(
concat(
[for group in module.eks_managed_node_group : group.iam_role_arn],
[for group in module.eks_managed_node_group : group.iam_role_arn if group.platform != "windows"],
[for group in module.self_managed_node_group : group.iam_role_arn if group.platform != "windows"],
var.aws_auth_node_iam_role_arns_non_windows,
)
Expand All @@ -479,6 +479,7 @@ locals {
node_iam_role_arns_windows = distinct(
compact(
concat(
[for group in module.eks_managed_node_group : group.iam_role_arn if group.platform == "windows"],
[for group in module.self_managed_node_group : group.iam_role_arn if group.platform == "windows"],
var.aws_auth_node_iam_role_arns_windows,
)
Expand Down
1 change: 1 addition & 0 deletions modules/eks-managed-node-group/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,4 +193,5 @@ module "eks_managed_node_group" {
| <a name="output_node_group_resources"></a> [node\_group\_resources](#output\_node\_group\_resources) | List of objects containing information about underlying resources |
| <a name="output_node_group_status"></a> [node\_group\_status](#output\_node\_group\_status) | Status of the EKS Node Group |
| <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 |
| <a name="output_platform"></a> [platform](#output\_platform) | Identifies if the OS platform is `bottlerocket`, `linux`, or `windows` based |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
9 changes: 9 additions & 0 deletions modules/eks-managed-node-group/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,12 @@ output "iam_role_unique_id" {
description = "Stable and unique string identifying the IAM role"
value = try(aws_iam_role.this[0].unique_id, null)
}

################################################################################
# Additional
################################################################################

output "platform" {
description = "Identifies if the OS platform is `bottlerocket`, `linux`, or `windows` based"
value = var.platform
}

0 comments on commit adb47f4

Please sign in to comment.