Menu
AWS CloudFormation
User Guide (API Version 2010-05-15)

Auto Scaling AutoScalingGroup TagProperty

The TagProperty property type adds tags to all associated instances in an Auto Scaling group.

The Tags property of the AWS::AutoScaling::AutoScalingGroup resource contains a list of TagProperty property types. For more information about Auto Scaling tags, see Tagging Auto Scaling Groups and Amazon EC2 Instances in the Auto Scaling User Guide.

AWS CloudFormation adds the following tags to all Auto Scaling groups and associated instances:

  • aws:cloudformation:stack-name

  • aws:cloudformation:stack-id

  • aws:cloudformation:logical-id

Syntax

JSON

Copy
{ "Key" : String, "Value" : String, "PropagateAtLaunch" : Boolean }

YAML

Copy
Key: String Value: String PropagateAtLaunch: Boolean

Properties

Key

The key name of the tag.

Required: Yes

Type: String

Value

The value for the tag.

Required: Yes

Type: String

PropagateAtLaunch

Set to true if you want AWS CloudFormation to copy the tag to EC2 instances that are launched as part of the auto scaling group. Set to false if you want the tag attached only to the auto scaling group and not copied to any instances launched as part of the auto scaling group.

Required: Yes

Type: Boolean

Example

The following example template snippet creates two Auto Scaling tags. The first tag, MyTag1, is attached to an Auto Scaling group named WebServerGroup and is copied to any EC2 instances launched as part of the Auto Scaling group. The second tag, MyTag2, is attached only to the Auto Scaling group named WebServerGroup.

Copy
"WebServerGroup" : { "Type" : "AWS::AutoScaling::AutoScalingGroup", "Properties" : { "AvailabilityZones" : { "Fn::GetAZs" : "" }, "LaunchConfigurationName" : { "Ref" : "LaunchConfig" }, "MinSize" : "1", "MaxSize" : "2", "LoadBalancerNames" : [ { "Ref" : "ElasticLoadBalancer" } ], "Tags" : [ { "Key" : "MyTag1", "Value" : "Hello World 1", "PropagateAtLaunch" : "true" }, { "Key" : "MyTag2", "Value" : "Hello World 2", "PropagateAtLaunch" : "false" } ] } }

On this page: