UPDATE: What fun is it when you need to login to each spawned instance and run ~/commands.sh to start mining? Copy pasting each instances’ public IP/DNS gets old quick. I would like to be able to mine when the spot instance is low with minimal effort.
Create a script that will be run on boot at /home/ubuntu/boot.sh

Finally add start autodoge to the /etc/rc.local file right before the exit call.
Now rc.local will start the autodoge service on boot which in turn runs boot.sh. You can edit boot.sh with your pool details and parameters. I have created AutoDoge Faucet – AMI-70439e18 which has this setup.