Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Amazon has two toolsets that have to be used for ami creation ec2 api tools and ec2 ami tools which both require EC2_HOME environmental variable to be set. So it seems like I can only use one of them toolsets at a time in a single terminal? and if I have to use another toolset - I have to export EC2_HOME variable to correct location every time I need to witch toolset - is this correct?

What would one do if I want to use both toolsets from single terminal. Iknow that I can open multiple terminals and setting EC2_HOME to various location that way - but it seems like a bit contr-productive.

any ideas?

share|improve this question
add comment

2 Answers 2

up vote 3 down vote accepted

When I install the standard ec2-api-tools and ec2-ami-tools packages on Ubuntu, things just work. I do this with:

sudo apt-get install ec2-api-tools ec2-ami-tools

When I install the EC2 API tools and AMI tools manually by downloading them from the pages you indicate (e.g., when I need the very latest versions) then I simply copy the contents of each bin, lib, and etc directory in to a single location like:

/usr/local/aws/bin/
/usr/local/aws/lib/
/usr/local/aws/etc/

Copy/move/extract all bin, lib, etc files and subdirectories from both EC2 downloaded zip files into those locations and then set a single envariable value (add this to $HOME/.bashrc or equivalent):

export EC2_HOME=/usr/local/aws

Once this is done, all commands should work from both sets of tools.

Here's my recipe for the tools you want to install:

sudo mkdir -p /usr/local/aws

wget http://s3.amazonaws.com/ec2-downloads/ec2-api-tools.zip
unzip ec2-api-tools.zip
sudo rsync -a --no-owner --no-group ec2-api-tools-*/{lib,bin} /usr/local/aws/

wget http://s3.amazonaws.com/ec2-downloads/ec2-ami-tools.zip
unzip ec2-ami-tools.zip
sudo rsync -a --no-owner --no-group ec2-ami-tools-*/{lib,bin,etc} /usr/local/aws/

You can also drop in the RDS tools, IAM tools, and the rest of the AWS command line tools.

share|improve this answer
    
just curiuos - ami tools also have etc directory. when I unzuip it. it that smthg important? should it also be copied perhaps? ther is only some publkic cert and 6 or some manifest files. –  Stann Sep 27 '11 at 0:22
    
Stann: Good point. I've added etc to the recipe above and simplified the rsync commands. –  Eric Hammond Sep 27 '11 at 1:12
add comment

This is vague and therefore probably not going to be me any rep, but in short, if you look at the man page for the tools you are using I think you will find that there are other ways to supply the variables than setting an environment variable. You can probably use command line switches to supply the variables each individual tool needs.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.