I follow these instructions to boot an instance of Windows ec2 using a powershell script (name it "bootstrap.ps1"). However, it seems like the script never runs when it first logs in. I check C: \ Program Files \ Amazon \ Ec2ConfigService \ Logs \ Ec2ConfigLog and I see this:
2014-03-11 00:08:02: Ec2HandleUserData: Start running user scripts
2014-03-11 00:08:02: Ec2HandleUserData: Could not find <script> and </script>
2014-03-11 00:08:02: Ec2HandleUserData: Could not find <powershell> and </powershell>
Here is what my script looks like:
<powershell>
(multiple lines of powershell script here)
</powershell>
I have a base64 coding script in Python and sending it via boto :
import base64
conn = ...
with open("bootstrap.ps1", "r") as fd:
conn.run_instances(..., user_data=base64.encodestring(fd.read()))
I made sure that:
- script I submit ("bootstrap.ps1") uses \ r \ n as line endings
- script,
http://169.254.169.254/latest/user-data base64-, "bootstrap.ps1", (, , base64.decodestring Python) <powershell> </powershell> "boostrap.ps1" .
, <powershell> </powershell> user_data. base-64, - ec2config? - , ?