To work with command line on the Amazon Cloud you need to get hold of the following file which is the EC2-api-tools look for the latest version here :
I used the file found here.
When trying to setup the Amazon EC2 tools you would expect to have some script that asks you key questions and sets up the environment for you.
Well not quite so.
Starting Point is here : Setting Up the Amazon EC2 Command Line Tools
1) Install the Java JDK (Java Development Kit) OR RTE ( Run Time Engine ) found here. For cento select the rpm.
13:30:16-root@controller:~$ yum install jre-7u9-linux-i586.rpm
2) Test the java installation
13:36:56-root@controller:~$ java -version
java version “1.7.0_09″
Java(TM) SE Runtime Environment (build 1.7.0_09-b05)
Java HotSpot(TM) Client VM (build 23.5-b02, mixed mode, sharing)
3) Download and unpack the api tools
13:38:39-root@controller:/tmp$ wget “http://s3.amazonaws.com/ec2-downloads/ec2-api-tools.zip”
13:39:49-root@controller:/tmp$ unzip ec2-api-tools.zip
4) Move it to the user home folder under a new folder e.g. ec2
13:39:52-root@controller:/$ mv /tmp/ec2-api-tools-1.6.4/ ~/ec2/
5) Create a softlink to the new version (used for rewiring later when new versions are installed)
13:39:53-root@controller:/$ ln -s ~/ec2/ec2-api-tools-1.6.4/ ~/ec2/api
Create a shell script with the following environment parameters to tell amazon where the stuff is and who you are:
I add this script to my /etc/profile.d/ec2 since only two users on this machine is me :).
#!/bin/bash export JAVA_HOME=/usr export EC2_HOME=/root/ec2/api export PATH=$PATH:$EC2_HOME/bin export AWS_ACCESS_KEY=XXXXXXXXXXX export AWS_SECRET_KEY=//XXXXXXXXXXXXXXXXX export EC2_URL=https://ec2.eu-west-1.amazonaws.com
Other Documents :