mardi 3 février 2015

instance in cloudformation does not run userdata

In a previous mixed ruby/shell script which manually creates resources, I would create a launch config, autoscale group with userdata to run on startup. When I create this same exact configuration with CF, the instance does not run the userdata.


here is the ruby code I use to inject the userdata into the CF template:



userdata = File.open(userdata_file, "rb").read
base64encoded_user_data=Base64.encode64(userdata)
template=template.gsub("#STARTUP_USERDATA",base64encoded_user_data.gsub("\n",""))


Oddly enough, when I do the exact same process for other userdata, it runs. Also, the same userdata file works fine for the old ruby/shell mix.


Help?


Aucun commentaire:

Enregistrer un commentaire