Adding name to EC2 instances when deploying AWS::EKS::Nodegroup in CloudFormation

不羁的心 提交于 2020-05-30 10:15:09

问题


I'm creating a CloudFormation template to deploy an EKS node group using the AWS::EKS::Nodegroup CloudFormation resource.

It looks like you can create tags for the node group resource specifically, but cannot change the name of the EC2 instances that are deployed as part of the node group. From the AWS documentation, it looks like tags are not propagated to other resources the node group deploys (such as EC2 instances).

Does anyone know of a way on how we can update the name of the EC2 instances when we deploy a new EKS node group? Would this require a lambda function to be executed to modify the EC2 instances?


回答1:


Currently there is no way to pass tag “Name” so that instance will be named appropriately. This is applicable to both terraform and cloud formation.

Two options I see here are;

  1. Lambda function that tags instances for you.

  2. You can bake it into an AMI. So, you would have a systemd script which will execute on boot and tag your instances as desired.



来源:https://stackoverflow.com/questions/59902283/adding-name-to-ec2-instances-when-deploying-awseksnodegroup-in-cloudformatio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!