user_data script on AWS Windows Instance
I am trying to pass a user_data script with my puppet launch code to deploy an EC2 instance and send a powershell script to just do a basic task like creating a directory and a txt file. But nothing happens on my windows instance after launch. Here are the code snippets... First image is from yaml file being referenced by hiera, second and third from my main puppet code file:
UPDATE: I renamed the file to test.ps1.erb and created it as a erb template but it still won't work. Also tried passing normal test.ps1 script without using template which also doesn't work. Am I doing something in a wrong way?
Referring to the example on github, I made a similar template test.erb (screenshot below) and that doesn't work either.
ANOTHER UPDATE: It only works if I assign template('module/test.erb') directly to user_data. For some reason it won't work if the same thing comes from the yaml file through Hiera. I have no idea why is it not going the second way... Please help!