To implement some functionalities that Amazons EC2 Cloud provides, you have to interface with their command-line API tools. Likely, the product is too young to have the equivalent functionality built-in to their GUI management console yet. For now, we do it this way, and its a little complex.
I setup the environment below on a mac. The setup steps are slightly different on a mac, than from what is explained on the amazon docs, which is angled for straight linux/unix. Mostly the difference is in how macs do environment variables and paths. Please adjust accordingly.
nano ~/.bash_profile export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home
$JAVA_HOME/bin/java -version java version "1.6.0_17" Java(TM) SE Runtime Environment (build 1.6.0_17-b04-248-10M3025) Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01-101, mixed mode)
You can use existing ones on the existing amazon account (if you have the private key from whoever originally made it), OR You can create your own new ones. Here I made new ones, according to the guide linked above.
mkdir ~/.ec2 mv ~/Downloads/pk-KFGXD35XEHEO5OUO3IE2OETS5UMPA3JA.pem ~/.ec2/ mv ~/Downloads/cert-KFGXD35XEHEO5OUO3IE2OETS5UMPA3JA.pem ~/.ec2/
These are used to run the command line calls that we will use later.
nano ~/.bash_profile export EC2_HOME=~/ec2-api-tools-1.3-46266 export PATH=$PATH:$EC2_HOME/bin export EC2_PRIVATE_KEY=~/.ec2/pk-KFGXD35XEHEO5OUO3IE2OETS5UMPA3JA.pem export EC2_CERT=~/.ec2/cert-KFGXD35XEHEO5OUO3IE2OETS5UMPA3JA.pem
# check to see that variables are there env # check to see that command and connection to AWS is working ec2-describe-regions # test create and stop an instance ec2-run-instances ami-b232d0db --key awsnickkey ec2-describe-instances i-dd2142b6 ec2-stop-instances i-dd2142b6 ec2-terminate-instances i-dd2142b6