Skip to main content
EKS Auto Mode lets AWS fully manage the compute plane of your EKS cluster. Instead of provisioning and managing EC2 node groups yourself, you enable Auto Mode and AWS automatically provisions, scales, and terminates nodes based on workload demand. This example shows two configurations: one using the built-in general-purpose node pool, and one using only custom node pools (where you manage the NodePool and EC2NodeClass resources yourself).

Prerequisites

  • AWS credentials configured with permissions to create EKS clusters, IAM roles, VPCs, and EC2 resources
  • Terraform >= 1.5.7
  • AWS provider >= 6.28
  • The example provisions its own VPC — no pre-existing VPC is required
Due to a limitation in the EKS Auto Mode API, disabling Auto Mode requires explicitly setting compute_config = { enabled = false } and applying before you can remove the block entirely. Simply removing the compute_config block will not disable Auto Mode.

Example code

The following is the complete main.tf from examples/eks-auto-mode.

Key concepts

Built-in node pools vs. custom node pools

compute_config block

  • enabled = true — turns on EKS Auto Mode for the cluster
  • node_pools — list of built-in pools to activate; valid values include general-purpose and system
  • Omitting node_pools (with create_auto_mode_iam_resources = true) means you bring your own Karpenter-style NodePool resources
When endpoint_public_access = true, the Kubernetes API is reachable from the internet. Restrict endpoint_public_access_cidrs to your own IP range in production.

Deploy

1

Initialize Terraform

Download the required providers and modules.
2

Review the plan

Preview what Terraform will create before applying.
3

Apply the configuration

Create the cluster and all supporting resources. Cluster creation typically takes 10–15 minutes.
4

Configure kubectl

Update your local kubeconfig so you can interact with the cluster.

Key outputs

After a successful apply the following outputs are available:

Cleanup

Before destroying, ensure no external resources (load balancers, persistent volumes, etc.) were created by workloads running on the cluster. Those are not managed by this Terraform configuration and must be deleted separately.

Full example on GitHub

View the complete example including outputs.tf, variables.tf, and versions.tf.