2017-09-15 14 views
0

创建的实例CloudFormation标签我如何添加名称标签由CloudFormation的LaunchConfig创建的实例?我认为这将在这一部分,但它不是一个选项。由LaunchConfig

{ 
    "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 
    } 
} 

我不知道是否应该创建一个实例资源,并把设置在那里,然后将其链接到launchconfig,但我无法找到任何文件,以支持这一想法。

回答

1

AWS::AutoScaling::LaunchConfiguration是指与意在由AWS::AutoScaling::AutoScalingGroup使用conjunctin使用。该AutoScalingGroup本身具有可用于设置其他标签中的实例名称Tags属性。关于这些标签的一个注意事项是,它们与大多数其他CloudFormation资源中使用的标签略有不同,因为它们具有PropogateAtLaunch属性,该属性表明该标签是应该应用于AutoScalingGroup的实例还是仅应用于AutoScalingGroup本身。有关更多详细信息,请参见Auto Scaling Tags Property Type

+0

谢谢,这个作品!我曾尝试这一点,但并没有意识到PropagateAtLaunch在标签领域必需的,所以失败了。这里更多:https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-tags.html#cfn-as-tags-PropagateAtLaunch – Paul