Skip to content

Conversation

bryantbiggs
Copy link
Member

Description

  • Correct variable defaults for ami_id and kubernetes_version
    • Since ami_id was not set to nullable = false in the sub-modules, the root module would pass down a null value which does not meet the check requirements here
      ami_type = var.ami_id != "" ? null : var.ami_type
      release_version = var.ami_id != "" ? null : var.use_latest_ami_release_version ? local.latest_ami_release_version : var.ami_release_version
      version = var.ami_id != "" ? null : var.kubernetes_version
      . Adding nullable = false means the "" is used which maintains the desired behavior and corrects the issue

Looks like I forgot a few try() cleanups from a previous PR - those are completed now in this PR and validated

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

type = map(object({
create = optional(bool, true)
create = optional(bool)
kubernetes_version = optional(string)
Copy link
Member Author

Choose a reason for hiding this comment

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

removing the try() logic helped catch this missing argument

create_access_entry = optional(bool)
iam_role_arn = optional(string)
# Security group
vpc_security_group_ids = optional(list(string), [])
Copy link
Member Author

Choose a reason for hiding this comment

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

removing the try() logic helped catch this missing argument

@bryantbiggs bryantbiggs requested a review from antonbabenko July 24, 2025 19:10
Copy link
Member

@antonbabenko antonbabenko left a comment

Choose a reason for hiding this comment

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

Lgtm

@bryantbiggs bryantbiggs merged commit 8807e0b into terraform-aws-modules:master Jul 24, 2025
20 checks passed
@bryantbiggs bryantbiggs deleted the fix/variable-defaults branch July 24, 2025 20:28
antonbabenko pushed a commit that referenced this pull request Jul 24, 2025
## [21.0.3](v21.0.2...v21.0.3) (2025-07-24)

### Bug Fixes

* Correct variable defaults for `ami_id` and `kubernetes_version` ([#3437](#3437)) ([8807e0b](8807e0b))
@antonbabenko
Copy link
Member

This PR is included in version 21.0.3 🎉

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 Aug 24, 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.

v21: EKS Managed Node Group ignores multiple AMI and K8s version related variables
2 participants