You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3, because the PR involves multiple changes across different configuration files, including the addition of new resources and updating existing configurations. The changes are not overly complex but require a good understanding of Terraform and AWS EKS components to ensure they are correct and do not introduce regressions.
🧪 Relevant tests
Yes
⚡ Possible issues
Version Mismatch: The kube_proxy_version is set to "v1.27.10-eksbuild.2" in variables.tf, but the test configuration in tests/main.tf uses "v1.28.6-eksbuild.2". This discrepancy could lead to inconsistencies and should be aligned.
Dependency Management: The depends_on attribute for both coredns and kube_proxy resources depends solely on [module.node_pool]. If there are other dependencies that affect the initialization or configuration of these addons, they should be explicitly included to avoid potential runtime issues.
Reduce redundancy by using a dynamic block for conflict resolution settings.
Consider using a dynamic block for resolve_conflicts_on_create and resolve_conflicts_on_update to reduce redundancy and improve maintainability. This approach allows you to define these properties in one place and reuse them across different resources.
Improve flexibility by conditionally setting the service_account_role_arn.
It is recommended to handle the service_account_role_arn with a conditional check rather than setting it to null directly. This can help in future configurations where a specific role might be needed based on certain conditions.
count = length(var.node_pools) > 0 ? 1 : 0
+validation {+ condition = length(var.node_pools) > 0+ error_message = "At least one node pool must be specified."+}
Bug
Align the default kube_proxy_version with the EKS version to ensure compatibility.
Ensure the default version of kube_proxy_version matches the EKS version to avoid compatibility issues. The default set in variables.tf does not match the eks_version set in tests/main.tf.
Update the default eks_version to maintain consistency with test configurations.
Update the eks_version default value to match the latest version used in the test configurations to maintain consistency across your Terraform configurations.
Use a dynamic block for conditional module dependencies.
It's recommended to use a dynamic block for depends_on when referencing modules, especially when the dependency is conditional based on a variable like var.node_pools. This ensures that the dependency is handled correctly during the Terraform plan and apply phases.
Improve the robustness of conditional resource creation.
To avoid potential issues with resource creation based on the count of node pools, consider using a more explicit conditional check or handling the scenario where var.node_pools might be undefined or null.
Align the default kube_proxy_version with the eks_version to ensure compatibility.
The default value for kube_proxy_version is set to "v1.27.10-eksbuild.2", which is inconsistent with the eks_version of "1.28" specified in tests/main.tf. Aligning these versions can prevent compatibility issues.
Use separate IAM roles for different EKS addons to adhere to the principle of least privilege.
Reusing the IAM role aws_iam_role.eks_addon_ebs_csi_role for the coredns addon might lead to permission issues if the role's policies are not properly scoped for both coredns and ebs_csi. Consider creating a separate IAM role for coredns to ensure least privilege access control.
Review and potentially diversify conflict resolution strategies for different EKS addons.
Using the same resolve_conflicts_on_create and resolve_conflicts_on_update settings for both coredns and kube_proxy addons might not be suitable for all scenarios. Review if different strategies might be needed based on the specific requirements of each addon.
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.
PR Type
Enhancement, Bug fix
Description
addons.tf
), improving maintainability.kube_proxy
addon configuration to the EKS setup.coredns
addon configuration to reflect new version requirements.variables.tf
to support the latest versions and new components.Changes walkthrough 📝
addon_coredns.tf
Remove CoreDNS resource configuration
addon_coredns.tf
coredns
resource configuration.variables.tf
Update and Add Variables for EKS Components
variables.tf
csi_driver_version
andcoredns_version
.kube_proxy_version
.eks_version
default value.addons.tf
Consolidate Addons and Add Kube Proxy Configuration
addons.tf
kube_proxy
addon configuration.coredns
addon configuration.main.tf
Update Test Configuration with Kube Proxy Version
tests/main.tf
kube_proxy_version
variable to the test configuration.