简化AWS CLI操作的jungle

Jungle是一款基于Linux命令风格的命令行工具,旨在简化AWS EC2和ELB的操作流程。通过简洁的命令如ls、up、down等,用户可以轻松地进行实例的查找、开关机及登录等操作。

github上最近有一个库叫jungle。

由于作者觉得官方的CLI命令太繁琐,命令行太长,于是做了一个参数类似于Linux命令的命令行工具。

地址

https://github.com/achiku/jungle

现在只支持EC2的查找,开关机,登录,以及ELB的查找。

安装

pip install jungle

可以看到后台它还是使用boto3作为基础库


You are using pip version 6.1.1, however version 7.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting jungle
  Downloading jungle-0.0.15.tar.gz
Collecting boto3==1.1.1 (from jungle)
  Downloading boto3-1.1.1-py2.py3-none-any.whl (95kB)
    100% |¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€| 98kB 1.8MB/s 
Collecting click==5.1 (from jungle)
  Downloading click-5.1-py2.py3-none-any.whl (65kB)
    100% |¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€| 65kB 1.6MB/s 
Requirement already satisfied (use --upgrade to upgrade): jmespath<1.0.0,>=0.6.2 in /usr/lib/python2.7/dist-packages (from boto3==1.1.1->jungle)
Requirement already satisfied (use --upgrade to upgrade): botocore<1.2.0,>=1.1.0 in /usr/lib/python2.7/dist-packages (from boto3==1.1.1->jungle)
Collecting futures==2.2.0 (from boto3==1.1.1->jungle)
  Downloading futures-2.2.0-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): python-dateutil<3.0.0,>=2.1 in /usr/lib/python2.7/dist-packages (from botocore<1.2.0,>=1.1.0->boto3==1.1.1->jungle)
Requirement already satisfied (use --upgrade to upgrade): docutils>=0.10 in /usr/lib/python2.7/dist-packages (from botocore<1.2.0,>=1.1.0->boto3==1.1.1->jungle)
Requirement already satisfied (use --upgrade to upgrade): six in /usr/lib/python2.7/dist-packages (from python-dateutil<3.0.0,>=2.1->botocore<1.2.0,>=1.1.0->boto3==1.1.1->jungle)
Installing collected packages: futures, boto3, click, jungle
  Running setup.py install for jungle
Successfully installed boto3-1.1.1 click-5.1 futures-2.2.0 jungle-0.0.15

使用

ls命令

jungle ec2 ls
web1    running i-b7d7b95e      172.31.xxx   xxx.xxx.xxx.xxx
web2    running i-dad9b733      172.31.xxx   xxx.xxx.xxx.xxx
web3    running i-dbd9b732      172.31.xxx   xxx.xxx.xxx.xxx
DB1    running i-b6d7b95f      172.31.xxx   xxx.xxx.xxx.xxx
DB2    running i-49d9b7a0      172.31.xxx   xxx.xxx.xxx.xxx
DB3    running i-f7a0cf1e      172.31.xxx   xxx.xxx.xxx.xxx

表格说明:Name标签值,状态,nodeID,内网IP,外网IP

注意:实例一定要有Name标签,不然会不在列表中


命令说明

<span style="color:#ff0000;">jungle</span>
Usage: jungle [OPTIONS] COMMAND [ARGS]...

  aws operation cli

Options:
  --help  Show this message and exit.

Commands:
  ec2  EC2 CLI group
  elb  ELB CLI group



<span style="color:#ff0000;">jungle elb</span>
Usage: jungle elb [OPTIONS] COMMAND [ARGS]...

  ELB CLI group

Options:
  --help  Show this message and exit.

Commands:
  ls  List ELB instances

<span style="color:#ff0000;">jungle ec2 </span>
Usage: jungle ec2 [OPTIONS] COMMAND [ARGS]...

  EC2 CLI group

Options:
  --help  Show this message and exit.

Commands:
  down  Stop EC2 instance
  ls    List EC2 instances
  ssh   SSH to EC2 instance
  up    Start EC2 instance

现在这个库功能还稍显简陋,但也会获得一些特定目标层的青睐。

例如专门的EC2使用者(非运维人员)可以使用这个工具自己开关机。


评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值