ASG Volume tags

12 views
Skip to first unread message

James Morgan

unread,
Feb 13, 2019, 10:37:29 AM2/13/19
to Ansible Project
Hi,

Does anybody know how to get tags applied to volumes associated with instances created as part of an ASG?

Instances tags are propagated fine, just no way to tag the volumes that I can see

Many thanks

James

Karl Auer

unread,
Feb 14, 2019, 8:21:03 PM2/14/19
to ansible-project
Not sure, but you could check out launch templates. There's no way to do it directly via a launch configuration that I know of.

You CAN do it after the fact by running appropriate userdata scripts, and there is some discussion out there on the Internet about ways to do this.

You can also use the AWS CLI to tag the volumes after they've been created. For example, run a cron job that locates untagged volumes, loads up the instance details and then tags the volumes with e.g. one or more of the instance tags. That may or may not be some thing you could do with Ansible.

Regards, K.


--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/e1025a40-95ce-47f8-bc74-c885f188f00f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Karl Auer

Email  : ka...@2pisoftware.com
Website: http://2pisoftware.com


GPG/PGP : 958A 2647 6C44 D376 3D63 86A5 FFB2 20BC 0257 5816
Previous: F0AB 6C70 A49D 1927 6E05 81E7 AD95 268F 2AB6 40EA

James Morgan

unread,
Feb 15, 2019, 4:22:43 AM2/15/19
to ansible...@googlegroups.com
Hi thanks

Some good suggestions. I did some more digging and found 


Using lambda looks like an interesting approach. Gets invoked when there is an autoscale event. 

I've already got custom user data scripts. That have instance tag info So that could be the easiest approach. Would just need to change the IAM role to allow tagging and looking up volumes

Thanks 

You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/pxluRL_YNrc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.

To post to this group, send email to ansible...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages