问题
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;
Lambda function that tags instances for you.
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