resource "aws_eks_cluster" "main" { name = "${var.project}-eks-${var.environment}" role_arn = aws_iam_role.eks_cluster.arn version = "1.29" vpc_config { subnet_ids = aws_subnet.private[*].id endpoint_private_access = true endpoint_public_access = false security_group_ids = [aws_security_group.eks_cluster.id] } encryption_config { provider { key_arn = aws_kms_key.eks.arn } resources = ["secrets"] } enabled_cluster_log_types = ["api", "audit", "authenticator"] } resource "aws_eks_node_group" "main" { cluster_name = aws_eks_cluster.main.name node_group_name = "main" node_role_arn = aws_iam_role.eks_node.arn subnet_ids = aws_subnet.private[*].id scaling_config { desired_size = 3 max_size = 10 min_size = 2 } }