Setting up the AWS EC2 CLI tools with required dependencies.

To setup the EC2 CLI tools we need the following.

1) JDK/JRE installed
2) The EC2 keys
3) The EC2-API-Tools

Before we install the tools we need to install at least JRE on the instance.

#1) Download JDK or JRE from shell

wget –no-cookies –no-check-certificate –header “Cookie:” “”

#2) Download EC2 CLI Tools.

wget –quiet
sudo apt-get install unzip
sudo unzip

#3) Create a directory to house the JDK and EC2 credentials
    sudo mkdir /usr/local/java
    sudo mkdir credentials

    sudo cp jdk-7u4-linux-x64.tar.gz /usr/local/java
    cd /usr/local/java
    sudo tar xvzf jdk-7u4-linux-x64.tar.gz

#4) SFTP the keys to directory ‘credentials’

#5) Set the Env Variables
    echo ‘ export JAVA_HOME=”/usr/local/java/jdk1.7.0_04/jre/”‘ >>/home/ubuntu/.profile
    echo ‘ export EC2_HOME=”/home/ubuntu/ec2-api-tools-”‘ >>/home/ubuntu/.profile
    echo ‘ export EC2_CERT=”/home/ubuntu/credentials/{your key.crt}”‘ >>/home/ubuntu/.profile
    echo ‘ export EC2_PRIVATE_KEY=”/home/ubuntu/credentials/{your key.pem}”‘ >>/home/ubuntu/.profile

#6) Changes in bash file made to come to effect.
       . .profile

For Amazon Web Services (AWS) Course