I'm following this tutorial: https://help.ubuntu.com/community/EC2StartersGuide
To start an instance, you run:
ec2-run-instances ami-xxxxx -k ec2-keypair
Then run:
ec2-describe-instances
which gets you the external host name of the instance.
And later, to ssh, you run:
ssh -i /path/to/ec2-keypair.pem ubuntu@<external-host-name>
This works fine, but here is my question:
How can I automate this in a bash script? Can I somehow parse the response returned from "ec2-describe-instances"?