eks-managed-node-group sub-module provisions an aws_eks_node_group resource plus the supporting IAM role, security group, and EC2 launch template. By default it creates a fully customized launch template (enabling custom security groups, tag propagation, and metadata options), but can fall back to the EKS-managed default template when use_custom_launch_template = false.
Standalone vs. root module usage
- Via root module (recommended)
- Standalone
The most common pattern is to declare node groups inside the root
eks module using the eks_managed_node_groups variable. The root module calls this sub-module internally for each entry.Key inputs
Node group sizing
Minimum number of nodes in the node group.
Maximum number of nodes in the node group.
Desired number of nodes. The EKS node group will attempt to maintain this count.
EC2 instance types for the node group. When multiple types are provided, EKS selects from the list. Defaults to
["t3.medium"].Purchasing option. Valid values:
ON_DEMAND, SPOT.Subnet IDs for the node group. Subnets must have the
kubernetes.io/cluster/CLUSTER_NAME tag.AMI configuration
AMI family for the node group. Common values:
AL2023_x86_64_STANDARD, AL2023_ARM_64_STANDARD, BOTTLEROCKET_x86_64, BOTTLEROCKET_ARM_64, WINDOWS_CORE_2022_x86_64.Custom AMI ID. When set,
enable_bootstrap_user_data must be true to inject the cluster bootstrap configuration.Specific AMI release version to pin. Defaults to the latest version for the given
ami_type and Kubernetes version.Kubernetes version for the node group. Defaults to the EKS cluster version.
Launch template
Create a custom EC2 launch template. When
false, EKS uses its own default launch template.Use the custom launch template. Set to
false to use the EKS default template, which enables disk_size and remote_access options (incompatible with a custom template).EBS volume configuration for the root and any additional volumes. Supports
volume_size, volume_type, encrypted, kms_key_id, iops, throughput, and more.IMDSv2 settings. Defaults to
http_tokens = "required" (IMDSv2 enforced) with a hop limit of 1.Enable detailed EC2 instance monitoring (1-minute CloudWatch metrics).
Enable Elastic Fabric Adapter (EFA) network interfaces. Required for HPC and GPU workloads that need high-bandwidth, low-latency networking.
Node bootstrapping
Inject EKS bootstrap configuration into user data. Only required when using a custom AMI via
ami_id.Shell script to run before the EKS bootstrap script. Not used with Bottlerocket AMIs.
Shell script to run after the EKS bootstrap script. Not used with Bottlerocket AMIs.
Additional arguments passed to the bootstrap script. For Bottlerocket, these are additional TOML settings for the user data.
IAM role
Create a new IAM role for the node group. Set to
false to provide an existing role via iam_role_arn.ARN of an existing IAM role. Required when
create_iam_role = false.Additional managed policies to attach to the node IAM role.
Attach
AmazonEKS_CNI_Policy (IPv4) or AmazonEKS_CNI_IPv6_Policy (IPv6) to the node role. Only disable if you assign CNI permissions to the aws-node DaemonSet via another method.Kubernetes
Kubernetes node labels managed by the EKS API.
Kubernetes taints to apply to nodes. Maximum 50 taints per node group.
Rolling update settings. Defaults to
max_unavailable_percentage = 33.Automatic node repair settings. When enabled, EKS will automatically replace unhealthy nodes.
Key outputs
| Output | Description |
|---|---|
node_group_arn | ARN of the EKS node group |
node_group_id | Cluster name and node group name joined by : |
node_group_status | Current status of the node group |
node_group_autoscaling_group_names | Names of the underlying Auto Scaling Groups |
node_group_labels | Labels applied to the node group |
node_group_taints | Taints applied to the node group |
iam_role_arn | ARN of the node IAM role |
iam_role_name | Name of the node IAM role |
launch_template_id | ID of the EC2 launch template |
launch_template_arn | ARN of the EC2 launch template |
launch_template_name | Name of the EC2 launch template |
launch_template_latest_version | Latest version number of the launch template |
security_group_id | ID of the node security group |
security_group_arn | ARN of the node security group |
Resources created
aws_eks_node_group.this— the EKS managed node groupaws_launch_template.this— EC2 launch templateaws_iam_role.this— node IAM roleaws_iam_role_policy.this— optional inline IAM policyaws_iam_role_policy_attachment.this— standard node group policiesaws_security_group.this— node security groupaws_vpc_security_group_ingress_rule.this/aws_vpc_security_group_egress_rule.this— security group rulesaws_placement_group.this— EC2 placement group (whencreate_placement_group = true)
