resource "aws_eks_node_group" "node" { cluster_name = aws_eks_cluster.aws_eks.name node_group_name = "node" node_role_arn = aws_iam_role.eks_nodes.arn # change this to your subnet ids subnet_ids = ["subnet-03425fce64e1d9cc5", "subnet-01765ab9b3f13dace"] # you can change this to you want instance type instance_types = ["t3.xlarge"]
# you can change desired_size for default node count scaling_config { desired_size = 3 max_size = 5 min_size = 1 }
# Ensure that IAM Role permissions are created before and deleted after EKS Node Group handling. # Otherwise, EKS will not be able to properly delete EC2 Instances and Elastic Network Interfaces. depends_on = [ aws_iam_role_policy_attachment.CloudWatchAgentServerPolicy, aws_iam_role_policy_attachment.AmazonEKSWorkerNodePolicy, aws_iam_role_policy_attachment.AmazonEKS_CNI_Policy, aws_iam_role_policy_attachment.AmazonEC2ContainerRegistryReadOnly, ] }
Then you can run terraform plan check something to change. If any change is ok then you can run terraform apply to set up infrastructure.