Short how-to about configuring Ubuntu to work with EC2 API ( for Ubuntu 10.04 users – Sun JDK was moved to partner repository so please check out Where’s sun JDK on Ubuntu 10.04 ? before follow described steps ).

1) Remove openjdk, gij
sudo apt-get remove openjdk-*;
sudo apt-get remove gij-*;

2) Install good one java powered by Sun
sudo apt-get install sun-java6-jdk

3) Install EC2 API
cd /home/abokov/
http://s3.amazonaws.com/ec2-downloads/ec2-api-tools.zip
unzip ec2-api-tools.zip

4) Configure environment : add this lines onto the end of ~/.bashrc
#ec2 deal with stuff
export JAVA_HOME=/usr/lib/jvm/java-6-sun
# setting up Amazon EC2
export EC2_HOME=/home/abokov/ec2-api-tools-1.3-30349
export PATH=$PATH:$EC2_HOME/bin:
export EC2_PRIVATE_KEY=/home/abokov/keys/pk-XXX.pem
export EC2_CERT=/home/abokov/keys/cert-XXX.pem

export EC2_ACCESS_KEY_ID=***
export EC2_SECRET_ACCESS_KEY=***

You may check out how it works using ec2-describe-instances.

Leave a Reply