Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Avoid trying to attach the node role when Auto Mode nodepools are not specified #3239

Merged

Conversation

bryantbiggs
Copy link
Member

Description

  • Avoid trying to attach the node role when Auto Mode nodepools are not specified

Motivation and Context

Breaking Changes

  • No

How Has This Been Tested?

  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • I have tested and validated these changes using one or more of the provided examples/* projects
  • I have executed pre-commit run -a on my pull request

@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bit hard to read, but it should work as expected. :)

@bryantbiggs bryantbiggs merged commit ce34f1d into terraform-aws-modules:master Dec 12, 2024
22 checks passed
@bryantbiggs bryantbiggs deleted the fix/auto-mode-role branch December 12, 2024 13:14
antonbabenko pushed a commit that referenced this pull request Dec 12, 2024
## [20.31.2](v20.31.1...v20.31.2) (2024-12-12)

### Bug Fixes

* Avoid trying to attach the node role when Auto Mode nodepools are not specified ([#3239](#3239)) ([ce34f1d](ce34f1d))
@antonbabenko
Copy link
Member

This PR is included in version 20.31.2 🎉

Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EKS Auto Mode - Failed to create when node_pools is not set, node_role_arn is set
2 participants