AWS EC2 can't execute user-data script

Posted by Bloodnut on Server Fault See other posts from Server Fault or by Bloodnut
Published on 2012-10-01T10:43:41Z Indexed on 2012/10/03 3:41 UTC
Read the original article Hit count: 505

Filed under:
|

I'm pretty new to AWS and EC2 but I want to run instances with a user script after it's booted from another instance. I have installed ec2 tools and ran the command as it's explained in various examples like here http://www.turnkeylinux.org/blog/ec2-userdata and Eric Hammond's tutorials. however when I actually use the command: "ec2-run-instances --key my-key --user-data-file myscript my-ami" it only runs the new instance but doesn't execute the script myscript contains: #!/bin/bash echo "hello" > ~/output.txt

I'm running ubuntu server 12.04 AMIs. the target AMIs are duplicates of the initiating instance.

if I run curl http:// 169.254.169.254/latest/user-data the imported script is there.

© Server Fault or respective owner

Related posts about amazon-ec2

Related posts about ubuntu-12.04