skip to Main Content

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


  1. Chosen as BEST ANSWER

    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
    

  2. You can use AWS CLI’s describe-launch-template-versions which returns UserData.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search