Reputation: 321
Can someone elaborate more on the details of how to remotely start a EC2 instance remotely?
I have a Linux box set up locally, and would like to set up a cronjob on it to start an instance in Amazon EC2. How do I do that?
I've never worked with API's, if there are ways to use API's, can someone please explain how to do so...
Upvotes: 3
Views: 4624
Reputation: 55866
Pretty Simple.
EC2_PRIVATE_KEY
and EC2_CERT
in as your envt variables, where they are private key
and certificate
files that you generate from EC2 console.ec2-reboot-instances instance_id [instance_id ...]
Done.
Edit 1
Do I download this directly onto my Linux box? And how do I access the CLI on the linux box of the EC2 API? Sorry to ask so many questions, just need to know detailed steps of how to do this.
Yes. Download it from here
If you have unzipped the API in /home/naishe/ec2api
, you can call /home/naishe/ec2api/bin/ec2-reboot-instance <instance_id>
. Or event better set unzipped location as your envt variable EC2_API_HOME
and append $EC2_API_HOME/bin
to your system's PATH
.
Also, try investing some time on Getting Started Doc which is amazingly simple.
Upvotes: 5