fix: Enable cleaner and more robust compute_config variable for downstream module consumption #3355
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
For the case where we are NOT using eks-auto mode, the previous for_each condition looks at length of var.cluster_compute_config, which is fine if we don't specify the variable cluster_compute_config. However, in the event if one needs to create a module referencing this module and makes an eks-auto toggle, this variable needs to be specified in the downstream module.
Motivation and Context
By making this change, it is more robust and allows downstream consumer to make a module that works for both eks-auto and normal eks.
Breaking Changes
No breaking change
How Has This Been Tested?
I have tested this in my environment, you could reproduce it by writing a new module to reference this eks module with the variable var.cluster_compute_config (type for each component needs to match).
In the new module:
Examples to use this new module:
For enabling EKS auto:
For standard EKS (NOT EKS Auto)
You could ignore this variable and it will take the default variable value