The Amazon EC2 API tools

Share this post:

I was recently asked to provide a snapshot ID to the AWS people and provide some more details. The only message I’ve got, was to initiate “ec2-describe-images” in the terminal and it will give me all I need. Huh?

Looking for some answers, I found out that there are actually EC2 API command line tools available and one can set them up and then interact with the AMI’s trough them. Once I knew that, it was only a matter of getting this set up properly on my MacOS X machine. Below is how I did it.

Of course, first you have to download the EC2 API tools from AWS. Extract them and move them to your folder (like ~/Documents/ is a good place).

After that you need to set the environment variables EC2_HOME, AWS_ACCESS_KEY and AWS_SECRET_KEY. That is a easy one, since all you have to do is:

[code]export EC2_HOME=~/Documents/ec2_api_tools
export AWS_ACCESS_KEY=<your access key>
export AWS_SECRET_KEY=<your secret key>
[/code]

(You can also add them to your .profile file to have those variables set permanently)

Once done, you can simply call all the available commands in the “/bin” directory, like:

[code]./ec2-describe-regions[/code]

(Again, you can also add the “/bin” directory to your path variable to have the tools available everywhere in your shell)

If the above returns you some regions you are good to go and get your AWS command line geek shine.

Over 10 years in business.

Self-funded. No investors. No bullshit.

More than 3,000 customers worldwide.

Helpmonks - no bullshit customer engagement service

Growth starts with action

Empower your team and delight your customers.

Helpmonks - email management for small businesses