Retrieve userdata from launch template

Viewed 28

I have a launch template in my account which is being used by an autoscaling group.

Is there any way I can retrieve the userdata which is baked inside the template from either the console or the aws cli?

I could always login an instance and find it there but I'm wondering if this functionality is exposed somehow

2 Answers

Thank you @Marcin, this is what I ended up using:

aws ec2 describe-launch-template-versions --launch-template-id lt-123 --query 'LaunchTemplateVersions[0].LaunchTemplateData.UserData' --output text | base64 -d
Related