简体   繁体   English

由LaunchConfig创建的实例的CloudFormation标记

[英]CloudFormation tags for instances created by LaunchConfig

How can I add a Name tag to instances created by CloudFormation's LaunchConfig? 如何为CloudFormation的LaunchConfig创建的实例添加Name标签? I thought it would be in this section, but it is not an option. 我认为这将在本节中,但它不是一个选项。

{
   "Type" : "AWS::AutoScaling::LaunchConfiguration",
   "Properties" : {
      "AssociatePublicIpAddress" : Boolean,
      "BlockDeviceMappings" : [ BlockDeviceMapping, ... ],
      "ClassicLinkVPCId" : String,
      "ClassicLinkVPCSecurityGroups" : [ String, ... ],
      "EbsOptimized" : Boolean,
      "IamInstanceProfile" : String,
      "ImageId" : String,
      "InstanceId" : String,
      "InstanceMonitoring" : Boolean,
      "InstanceType" : String,
      "KernelId" : String,
      "KeyName" : String,
      "PlacementTenancy" : String,
      "RamDiskId" : String,
      "SecurityGroups" : [ SecurityGroup, ... ],
      "SpotPrice" : String,
      "UserData" : String
   }
}

I wondered if I should create an instance resource and put settings in there, and then link it to the launchconfig, but I can't find any documentation to support that idea. 我想知道我是否应该创建一个实例资源并在其中放置设置,然后将其链接到launchconfig,但我找不到任何支持该想法的文档。

AWS::AutoScaling::LaunchConfiguration is meant to be used in conjunction with AWS::AutoScaling::AutoScalingGroup . AWS :: AutoScaling :: LaunchConfiguration旨在与AWS :: AutoScaling :: AutoScalingGroup结合使用。 The AutoScalingGroup itself has a Tags property that can be used for setting the instance name among other tags. AutoScalingGroup本身具有Tags属性,可用于在其他标记中设置实例名称。 One note about these tags, they're slightly different than the tags used in most other CloudFormation resources, as they have a PropagateAtLaunch property, which says if the tag should be applied to instances of the AutoScalingGroup, or just the AutoScalingGroup itself. 关于这些标记的一个注释,它们与大多数其他CloudFormation资源中使用的标记略有不同,因为它们具有PropagateAtLaunch属性,该属性表示标记应该应用于AutoScalingGroup的实例,还是仅应用于AutoScalingGroup本身。 See the Auto Scaling Tags Property Type for more details. 有关详细信息,请参阅Auto Scaling标签属性类型

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM