Does anyone know how to tag an AWS Autoscale spun EC2 instance via boto? I would like all Autoscale EC2 instances to have a prefix of 'as-'.
Thanks
amazon ec2
Does anyone know how to tag an AWS Autoscale spun EC2 instance via boto? I would like all Autoscale EC2 instances to have a prefix of 'as-'.
Thanks
Best Answer
I figured this out.
You assign a 'Name' tag to an AWS Autoscale group after it is created. The trick is to set the 'propagate_at_launch' flag to True when passing it to the Autoscale Tag object. This flag when set to True ensures that the tag will be applied to any Autoscale spun EC2 instance after the tag is created. An example follows:
Voila! Now whenever an EC2 instance is spun from this Autoscale group based on CloudWatch Alarms i.e. scale up based on CPU utilization thresholds or some other metric...that instance will have a name value = 'as-instance'
Cheers