we are deploying several eks clusters in our aws account and noticed the ec2 instances names are empty. This makes it hard for our qa and dev-ops teams to identify which eks cluster an ec2 instance belongs to.
It would be great if we could specify a name prefix for all the ec2 instances spun up by a nodegroup.
aws_eks_node_group
resource "aws_eks_node_group" "staging-service-example" {
cluster_name = aws_eks_cluster.example.name
node_group_name = "example"
node_role_arn = aws_iam_role.example.arn
subnet_ids = aws_subnet.example[*].id
# for example something like this
node_name_prefix = "staging-us-east-1"
scaling_config {
desired_size = 1
max_size = 1
min_size = 1
}
depends_on = [
aws_iam_role_policy_attachment.example-AmazonEKSWorkerNodePolicy,
aws_iam_role_policy_attachment.example-AmazonEKS_CNI_Policy,
aws_iam_role_policy_attachment.example-AmazonEC2ContainerRegistryReadOnly,
]
}
We tried to add the tag Name but it did not add anything to the nodes.
Maybe it would be possible to have the additional information be passed to the launch template that is created inside a additional_launch_config block for example. Also allowing to add additional security groups to nodes is not possible and would be very valuable.
additional_launch_config {
security_groups = ["sg-id123456"]
tags {
"Name" = "eks-instance-name"
}
}
Hi folks 👋 Thank you for your interest in this feature request. The EKS API does not implement this functionality, so it is not appropriate for it to be implemented in the Terraform AWS Provider at this time. Rather than keep this issue open and lingering with nothing actionable at the moment, we are going to opt to close this for now. When the API support exists, we will gladly implement it! 😄
In terms of future tracking of this functionality, you may be interested in:
aws_ec2_tag resource (potential workaround)I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!
Most helpful comment
We tried to add the tag
Namebut it did not add anything to the nodes.Maybe it would be possible to have the additional information be passed to the launch template that is created inside a additional_launch_config block for example. Also allowing to add additional security groups to nodes is not possible and would be very valuable.