在CloudFormation中部署AWS :: EKS :: Nodegroup时将名称添加到EC2实例 [英] Adding name to EC2 instances when deploying AWS::EKS::Nodegroup in CloudFormation

查看:323
本文介绍了在CloudFormation中部署AWS :: EKS :: Nodegroup时将名称添加到EC2实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个CloudFormation模板,以使用AWS :: EKS :: Nodegroup CloudFormation资源部署EKS节点组。

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

看起来您可以创建标签专门用于节点组资源,但不能更改作为节点组的一部分部署的EC2实例的名称。从AWS文档中,似乎标签没有传播到节点组部署的其他资源(例如EC2实例)。

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).

有人知道我们如何使用部署新的EKS节点组时,如何更新EC2实例的名称?是否需要执行lambda函数来修改EC2实例?

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?

推荐答案

当前无法传递标记名称 ,这样该实例将得到适当的命名。这适用于地形和云的形成。

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函数

  1. Lambda function that tags instances for you.

您可以将其烘焙到AMI中。因此,您将拥有一个systemd脚本,该脚本将在启动时执行并根据需要标记实例。

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.

这篇关于在CloudFormation中部署AWS :: EKS :: Nodegroup时将名称添加到EC2实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆