The Amazon EC2 API tools
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:
export AWS_ACCESS_KEY=<your access key>
export AWS_SECRET_KEY=<your secret key>
(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:
(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.