AWS ASG/EC2 Fleet with multiple launch templates and multiple userdata

For a use case, I felt the need for having multiple userdata scripts within a single AWS ASG (or maybe EC2 Fleet).

ref: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/autoscaling_group#mixed-instances-policy-with-instance-level-launchtemplatespecification-overrides

I searched for a bit to see if there is any existing module written by folks for this.

I got the multiple launch templates’ bit, but didn’t find a ready solution for multiple userdata one.

Just wanted to ping here, before trying something on my own.

BTW, the use case is a set of worker nodes which would be under Nomad (+ Consul) and have varying userdata sections, not all which can be purely parameterized.

Regards,
Shantanu Gadgil

1 Like

:eight_spoked_asterisk: Any ideas anyone?