terraform-aws-eks-cluster icon indicating copy to clipboard operation
terraform-aws-eks-cluster copied to clipboard

feat: add support for EKS Auto Mode

Open romulofranca opened this issue 6 months ago โ€ข 5 comments

what

  • Added support for EKS Auto Mode.
  • Introduced new variables to control Auto Mode: cluster_auto_mode_enabled, node_pools, create_node_role, and node_role_arn.
  • Updated the aws_eks_cluster resource to handle compute_config, elastic_load_balancing, and storage_config for 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 TestExamplesAutoMode to 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

romulofranca avatar May 21 '25 21:05 romulofranca

[!IMPORTANT]

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in 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.

โค๏ธ Share
๐Ÿชง 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 @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in 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 pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file 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.

coderabbitai[bot] avatar May 21 '25 21:05 coderabbitai[bot]

๐Ÿ’ฅ This pull request now has conflicts. Could you fix it @romulofranca? ๐Ÿ™

mergify[bot] avatar Jun 11 '25 10:06 mergify[bot]

/terratest

gberenice avatar Jun 13 '25 16:06 gberenice

[!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-reviews channel.

mergify[bot] avatar Jun 17 '25 20:06 mergify[bot]

@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.

Nuru avatar Jun 17 '25 21:06 Nuru

Any plans on wrapping the work in this PR up before EoY 2025?

SasquatchCorgi avatar Aug 25 '25 17:08 SasquatchCorgi

๐Ÿ’ฅ This pull request now has conflicts. Could you fix it @romulofranca? ๐Ÿ™

mergify[bot] avatar Sep 10 '25 13:09 mergify[bot]

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

Firaenix avatar Sep 17 '25 07:09 Firaenix