ASG Volume tags

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

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.

Hi thanks

Some good suggestions. I did some more digging and found

https://github.com/eheydrick/ebsautotagger/blob/master/README.md

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