I am trying to automate ec2 creation. I start an instance from a custom AMI, and specify a user data script during launch configuration. I have noticed that user data script is not being executed. How can I troubleshoot this and what am I missing? Maybe I can specify the script somewhere in AMI ? Thank you in advance.
My startup script :
#!/bin/sh
sudo su
systemctl start docker
docker run -it --publish 8080:8080 exampleapplication:latest
UPDATE : i removed the sudo su and added an echo command for debugging. I checked the system logs and saw my echoed string. And this is what i got for next lines
[ 16.291460] cloud-init[3200]: plsssssss
[ 17.378345] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[ 17.394716] Bridge firewalling registered
[ 17.412835] nf_conntrack version 0.5.0 (8192 buckets, 32768 max)
[ 17.479117] Initializing XFRM netlink socket
[ 17.489731] Netfilter messages via NETLINK v0.30.
[ 17.502725] ctnetlink v0.93: registering with nfnetlink.
[ 17.546680] IPv6: ADDRCONF(NETDEV_UP): docker0: link is not ready
[ 18.114688] cloud-init[3200]: the input device is not a TTY
[ 18.121279] cloud-init[3200]: May 31 15:11:07 cloud-init[3200]: util.py[WARNING]: Failed running /var/lib/cloud/instance/scripts/part-001 [1]
[ 18.131795] cloud-init[3200]: May 31 15:11:07 cloud-init[3200]: cc_scripts_user.py[WARNING]: Failed to run module scripts-user (scripts in /var/lib/cloud/instance/scripts)
[ 18.142379] cloud-init[3200]: May 31 15:11:07 cloud-init[3200]: util.py[WARNING]: Running module scripts-user (<module 'cloudinit.config.cc_scripts_user' from '/usr/lib/python2.7/site-packages/cloudinit/config/cc_scripts_user.pyc'>) failed
/var/log/cloud-init-output.log- John Rotenstein