Installing ec2-api-tools on Fedora

The Amazon ec2-api-tools package that is needed to access the command line API tools is not installed by default on their public AMIs, unlike the ec2-ami-tools package. It is not straightforward to install on Fedora because it is not available via yum and has some dependancies that are a little awkward to resolve. Having gone through this process, here is how to install the ec2-api-tools on Fedora.

1. Remove the default java from your system

[sourcecode language="bash"]yum remove java java-devel[/sourcecode]

2. Download the latest Java version from the Oracle website. In this case, I downloaded the Linux x64 RPM.

3. Create a java directory and then run the installer (where jre.bin is the name of the downloaded file):

[sourcecode language="bash"]mkdir /usr/java
cd /usr/java
chmod a+x jre.bin
./jre.bin
rpm -iv jre-6u20-linux-amd64.rpm[/sourcecode]

You will get a message saying the package is already installed. It will exist at /usr/java/jre1.6.0_20 with whatever version is the latest. This is the path you need for JAVA_HOME.

4. Download the ec2-api-tools zip package from the AWS website. Extract it to the place where you want to keep the binaries.

5. Set your EC2_HOME and JAVA_HOME directories:

[sourcecode language="bash"]export EC2_HOME=/path/to/extracted/ec2-api-tools/directory
export JAVA_HOME=/usr/java/jre1.6.0_20[/sourcecode]

You can now run the tools from the bin directory of the extracted ec2-api-tools. You will need to make sure your AWS private key and certificate files are present so you can reference them during the call, but the tool will complain and tell you what to do for these.

This entry was posted in Amazon, EC2, Fedora, Red Hat, Technical. Bookmark the permalink.

One Response to Installing ec2-api-tools on Fedora

  1. Don Lipps says:

    Thanks, David. I was banging my head on the Java side of this problem. Your instructions were perfect!