Alternative tools for Amazon EC2?

2019-03-10 06:22发布

Amazon's official tools for interacting with EC2 are kind of clunky and a pain to deal with. I have to set up a bunch of environment variables, store separate private keys just for EC2, add extra items to my PATH, and so on. They all output tab delimited lines that are hundreds of characters long with no headings, so it's a bit of a pain to interpret them. Their instructions for setting up an SSH keypair give you one that isn't protected by a passphrase, rather than letting you use an existing keypair that you already have. The programs are all just a bit clunky and aren't very good Unix programs.

So, are there any easier to use command line tools for accessing EC2? I know there is ElasticFox, and there is their web based console, which do make the process easier, but I'm wondering if anyone else has written better command line tools for interacting with EC2.

9条回答
在下西门庆
2楼-- · 2019-03-10 06:46

I have an open source graphical system admin tool called EC2Dream that replaces the command line tool. It installs on windows, linux and Mac OS clients and is written in Ruby and FXRuby. See www.ec2dream.com.

Neill Turner

www.ec2dream.com

查看更多
爱情/是我丢掉的垃圾
3楼-- · 2019-03-10 06:47

There is an entire industry called Cloud Management which try to solve this type of problems. Scalr and RightScale and the leaders in this sector (disclaimer: I work at Scalr).

Cloud management softwares are built on top of Amazon EC2 API (and usually on other public IaaS like Rackspace) and provide an improved user interface along with automation tools like backups or SSH management as you mentioned it. They don't provide easier command lines tools stricto sensu. Their goal is to make interaction with Amazon EC2 easier.

Different options are available in the market:

  • Scalr: Scalr is available as a hosted service with a trial version. Otherwise you can download and install the source code yourself, as it is released under the Apache 2 license.
  • RightScale: while they are usually considered as expensive for small businesses, they do offer a free account.
  • enStratus: they offer a freemium model like RightScale.
查看更多
叼着烟拽天下
4楼-- · 2019-03-10 06:48

the problem with alternative libraries is that they are not always kept up to date, so if new features for AWS are released, then you need to wait. You posted that your main problems are the bunch of environment variables, add extra items to your PATH, etc. We had this issue at BitNami, and is the main reason we created BitNami Cloud Tools that ships all of the AWS command line tools together with preconfigured Java and Ruby language runtimes. You only have to download it and everything that you need will be installed in a folder without modify your system configuration. We keep it regularly up to date.

查看更多
ら.Afraid
5楼-- · 2019-03-10 06:51

Not command line, but take a look at what a free RightScale account will give you - much, much easier than command line or ElasticFox IMO.

查看更多
甜甜的少女心
6楼-- · 2019-03-10 06:55

About ec2-api-tools:

I agree that they are a bit too clunky, I particular dislike the output of ec2-describe-instances. I recently switched to python-boto which offers a very clean and easy to use interface to ec2.

About not being able to specify a passphrase for the ssh key generated by EC2:

That's not the case. You can change the passphrase of any ssh private key anytime, using:

ssh-keygen -p -f /path/to/keyfile

E.g.

ssh-keygen -p -f ~/.ssh/id_rsa

About uploading your own ssh key pair:

You can use ec2-import-keypair, like this:

for i in $(ec2-describe-regions|cut -f 2);do
  ec2-import-keypair --region $i mykey --public-key-file ~/.ssh/id_rsa.pub
done

The example above will upload the public key in ~/.ssh/id_rsa.pub to every region under the name "mykey". Remember that each region has it's own keypair.

In order to have the key installed in your ec2 instances, you'll have to pass the "-k mykey" option to ec2-run-instances.

Incidentally, uploading your own keypair is the only way to login with the same key to all the instances in all regions. If you create the keypair from the web interface, you'll have a different key in every region.

查看更多
甜甜的少女心
7楼-- · 2019-03-10 07:00

I'm a bit late but I have a solution!

I found the same problems with the Amazon AMI tools. They're a decent reference implementation but very difficult to use particularly when you have more than a couple instances. I wrote a replacement command-line tool as part of another project, called Rudy that answers most of your concerns

The commands are more intuitive than Amazon's AMI tools:

  • rudy-ec2 instances -C
  • rudy-ec2 groups -A -p 8080 -a 11.22.33.44 group-name
  • rudy-ec2 volumes -C -s 100
  • rudy-ec2 images
  • ...

All configuration is in a single file (~/.rudy/config).

It can output in several formats (yaml, json, csv, tsv, and of course regular text):

rudy-ec2 -f yaml snapshots
--- 
:awsid: snap-2457b24d
:progress: 100%
:created: "2009-05-08T15:24:17.000Z"
:volid: vol-4ee10427
:status: completed

Regarding the private keys, There are no EC2 tools that allow to create private keys for with a password for booting a public instance because the API doesn't support it. However, if you create your own image, you can use your private keys.

Here's more info:

查看更多
登录 后发表回答