terraform-aws-eks-cluster
terraform-aws-eks-cluster copied to clipboard
feat: add support for EKS Auto Mode
what
- Added support for EKS Auto Mode.
- Introduced new variables to control Auto Mode:
cluster_auto_mode_enabled,node_pools,create_node_role, andnode_role_arn. - Updated the
aws_eks_clusterresource to handlecompute_config,elastic_load_balancing, andstorage_configfor Auto Mode. - Implemented validation to prevent enabling Auto Mode with self-managed addons.
- Created new IAM policies and roles to support Auto Mode (
auto_mode_policies,node_assume_role, and related attachments). - Updated the default Kubernetes version to 1.32.
- Improved outputs to handle optional values using
try()to support scenarios without node groups. - Added a new automated test
TestExamplesAutoModeto validate Auto Mode functionality. - Updated Go module dependencies to ensure compatibility with Kubernetes 1.32.
why
- EKS Auto Mode is a new AWS feature that simplifies node management by removing the need for self-managed node groups.
- Adding Auto Mode support allows users to opt for fully managed compute configurations without losing flexibility.
- Keeping the module updated with Kubernetes 1.32 ensures compatibility with the latest EKS features.
- Introducing dynamic outputs and IAM role handling improves the module's robustness when switching between Auto Mode and managed node groups.
- Automated tests ensure the new functionality works reliably and prevent regressions in future updates.
references
-
Related to EKS Auto Mode announcement: https://docs.aws.amazon.com/eks/latest/userguide/eks-auto-mode.html
-
Related PRs and discussions:
- https://github.com/cloudposse/terraform-aws-eks-cluster/issues/246 (Related Issue)
- https://github.com/cloudposse/terraform-aws-eks-cluster/pull/249 (Previous Auto Mode PR attempt)
[!IMPORTANT]
Review skipped
Auto incremental reviews are disabled on this repository.
Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.
๐ Walkthrough
Walkthrough
This change set introduces support for EKS Auto Mode, adding new variables and logic to manage compute resources and IAM roles conditionally. It updates the Kubernetes version to 1.32, modifies module and output configurations to handle optional node group creation, and adds validation and dependency management for the new features. Tests and dependencies are updated accordingly.
Changes
| Files/Paths | Change Summary |
|---|---|
examples/complete/fixtures.us-east-2.tfvars, examples/complete/variables.tf |
Updated Kubernetes version from "1.29" to "1.32". Added variables for EKS Auto Mode: cluster_auto_mode_enabled, node_pools, create_node_role, and node_role_arn. |
examples/complete/main.tf |
Passed new variables to the eks_cluster module. Node group creation is now conditional based on cluster_auto_mode_enabled. |
examples/complete/outputs.tf |
Outputs for node group now use try() and index access for safety if node group is not created. |
iam.tf |
Added logic for conditional creation and attachment of an IAM node role and policies. Extended assume role and policy attachments for EKS Auto Mode. |
main.tf |
Added support for EKS Auto Mode in the cluster resource, including dynamic blocks, lifecycle precondition, and extended dependencies. |
outputs.tf |
Added output for node_role_arn representing the ARN of the node IAM role used. |
variables.tf |
Introduced variables for EKS Auto Mode, node pool validation, and node role management, with input validation logic. |
test/src/examples_complete_test.go |
Added TestExamplesAutoMode to test EKS Auto Mode provisioning and output validation. |
test/src/go.mod |
Updated Go version, toolchain, and upgraded Kubernetes and related dependencies. Added and removed several indirect dependencies. |
โจ Finishing Touches
๐งช Generate Unit Tests
- [ ] Create PR with Unit Tests
- [ ] Post Copyable Unit Tests in Comment
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
๐ชง Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
I pushed a fix in commit <commit_id>, please review it.Explain this complex logic.Open a follow-up GitHub issue for this discussion.
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:@coderabbitai explain this code block.@coderabbitai modularize this function.
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.@coderabbitai read src/utils.ts and explain its main purpose.@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.@coderabbitai help me debug CodeRabbit configuration file.
Support
Need help? Create a ticket on our support page for assistance with any issues or questions.
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (Invoked using PR comments)
@coderabbitai pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai generate docstringsto generate docstrings for this PR.@coderabbitai generate sequence diagramto generate a sequence diagram of the changes in this PR.@coderabbitai auto-generate unit teststo generate unit tests for this PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile to the root of your repository. - Please see the configuration documentation for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.
๐ฅ This pull request now has conflicts. Could you fix it @romulofranca? ๐
/terratest
[!IMPORTANT]
Cloud Posse Engineering Team Review Required
This pull request modifies files that require Cloud Posse's review. Please be patient, and a core maintainer will review your changes.
To expedite this process, reach out to us on Slack in the
#pr-reviewschannel.
@romulofranca Thank you very much for this substantial effort!
Unfortunately, this major a PR requires a lot of thoughtful review, not only for its impact on this module, but also for how it coordinates with our other modules such as eks-node-group, and components such as eks-alb-controller and eks-karpenter-node-pool. Given our current workload and resources, it may be quite a while before we get to this.
Any plans on wrapping the work in this PR up before EoY 2025?
๐ฅ This pull request now has conflicts. Could you fix it @romulofranca? ๐
I'd love this to be merged, I'm considering swapping to a different EKS TF module but cloudposse ones are by far the best