README

eks-nodes

Creates EKS managed node groups with configurable instance types, taints, labels, and KMS-encrypted volumes.

Provisions one or more EKS managed node groups with a worker node IAM role (or an externally supplied one), scaling configuration, instance-level taints and labels for workload scheduling, and per-group launch templates for KMS-encrypted EBS volumes. IMDSv2 is enforced on all nodes via the launch template.

Usage

module "eks_nodes" {
  source  = "hcassc.jfrog.io/iac-terraform-modules-virtual/compute/eks-nodes/aws"
  version = "0.1.0"

  cluster_name = module.eks.id

  node_groups = {
    general = {
      name           = "general"
      subnet_ids     = module.vpc.private_subnet_id_list
      instance_types = ["m5.xlarge"]
      desired_size   = 3
      max_size       = 10
      kms_key_arn    = module.kms.key_arn
    }
  }
}

Requirements

Name Version
terraform ~> 1.5
aws ~> 6.50

Providers

Name Version
aws 6.50.0

Resources

Name Type
aws_eks_node_group.this resource
aws_iam_role.node resource
aws_iam_role_policy_attachment.node resource
aws_launch_template.node resource

Inputs

Name Description Type Default Required
cluster_name EKS cluster name to attach node groups to string n/a yes
create_node_role Create a default node IAM role when node_role_arn is null bool true no
node_groups Map of managed node group definitions map(object({ name = string subnet_ids = list(string) instance_types = optional(list(string), ["m5.large"]) ami_type = optional(string, "AL2_x86_64") capacity_type = optional(string, "ON_DEMAND") disk_size = optional(number, 50) min_size = optional(number, 1) max_size = optional(number, 5) desired_size = optional(number, 2) kms_key_arn = optional(string, null) labels = optional(map(string), {}) taints = optional(list(object({ key = string value = optional(string, null) effect = string })), []) max_unavailable = optional(number, 1) })) {} no
node_role_arn ARN of the IAM role for worker nodes (created externally or via iam-role module) string null no
tags Resource tags to apply to all resources map(string) {} no

Outputs

Name Description
node_group_arns Map of node group logical key to ARN
node_group_ids Map of node group logical key to ID
node_role_arn ARN of the node IAM role