• Stars
    star
    844
  • Rank 53,983 (Top 2 %)
  • Language
    Python
  • License
    MIT License
  • Created over 9 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

AWS operations by cli should be simpler

jungle

PyPI version GitHub license Build Status codecov.io

Description

jungle makes AWS operations from terminal simpler and more intuitive.

Why created

awscli is by far the most comprehensive CLI tool manipulating various AWS services, and I really like its flexible options and up-to-date release cycle. However, day-to-day AWS operations from my terminal don't need that much flexibility and that many services. Rather, I wanted just small set of UNIX-like commands which are easy to use and remember.

Installation

pip install jungle

Usage

EC2

I would highly recommend to use ssh-agent to manage your ssh keys and pass phrases. If you ssh-add your keys, ssh-agent automatically select appropriate key when you try to login to a box. This makes it much easier to use jungle ec2 ssh, or ssh command in general, since you don't have to specify --key-file /path/to/key.pem for each EC2 instance.

Listing all EC2 instances (each attribute is separated by a tab)

jungle ec2 ls

Listing all EC2 instances in formatted output(each attribute is separated with space and is aligned)

jungle ec2 ls -l

Filtering EC2 instances by Name tag

jungle ec2 ls blog-web-server-01

Filtering EC2 instances by Name tag using wildcard

jungle ec2 ls '*web*'

Starting instance

jungle ec2 up -i i-xxxxxx

Stopping instance

jungle ec2 down -i i-xxxxxx

SSH login to instance specified by instance id

jungle ec2 ssh -i i-xxxxxx --key-file /path/to/key.pem --port 1234

SSH login to instance specified by Tag Name

jungle ec2 ssh -n blog-web-server-01 --key-file /path/to/key.pem

SSH login to instance specified by Tag Name with wildcard (you'll be prompted to choose which server to log in)

jungle ec2 ssh -n 'blog-web-server-*' --key-file /path/to/key.pem

SSH login to instance specified by Tag Name through gateway instance

jungle ec2 ssh -n blog-web-server-01 --key-file /path/to/key.pem -g i-xxxxxx

SSH login to instance specified by Tag Name using auto ssh key discovery

jungle ec2 ssh -n blog-web-server-01

SSH login to instance gateway instance, specifying username for each instance, while disabling known_hosts prompt.

jungle ec2 ssh -i i-xxxxxx -u ec2-user -k /path/to/key.pem -s "-o UserKnownHostsFile=/dev/null" -g i-xxxxxx -x core

--dry-run gives you ssh command and exits.

jungle ec2 ssh -n blog-web-server-01 -u ec2-user --dry-run
ssh xxx.xxx.xxx.xxx@ec2-user

-P/--profile-name specify AWS profile name.

jungle ec2 -P myprofile ssh -n blog-web-server-01 -u ec2-user

ELB

Listing all ELB instances

jungle elb ls

Listing a ELB instance

jungle elb ls production-blog-elb

Listing ELB attached EC2 instances

jungle elb ls -l production-blog-elb

EMR

jungle emr ls
jungle emr ssh -k /path/to/key.pem -i j-xxxxxxx
jungle emr rm -i j-xxxxxxx

AutoScaling

jungle asg ls

RDS

jungle rds ls

Autocompletion (currently only supports bash)

Execuging the following command prints bash autocompletion script. Copy and past or redirect to your favorite file (e.g. /etc/bash_completion.d/jungle, ~/.bashrc). This is a function of click, which internally used by jungle.

$ _JUNGLE_COMPLETE=source jungle

Configuration

You can create the credential file yourself. By default, its location is at ~/.aws/credentials

[default]
aws_access_key_id = YOUR_ACCESS_KEY
aws_secret_access_key = YOUR_SECRET_KEY

You may also want to set a default region. This can be done in the configuration file. By default, its location is at ~/.aws/config

[default]
region = us-east-1

More detailed configurations can be found in the boto3 documentation.

Boto3 Doc - Configuration

More Repositories

1

planter

Generate PlantUML ER diagram textual description from PostgreSQL tables
Go
546
star
2

wbs

Watch, build, and (re)start Go server auto-reloader customizeable by toml
Go
54
star
3

sample-golang-soap-xml

Golang SOAP examples
Go
38
star
4

pgpart

Creating PostgreSQL partitioned table DDL should be easier.
Python
31
star
5

soapc

Golang SOAP client
Go
24
star
6

varfmt

Convert string into Go variable name following Go naming convention
Go
22
star
7

hipnotify

Deadly simple HipChat API V2 room notification library
Python
17
star
8

pgtxdb

Single transaction sql driver for golang
Go
16
star
9

sample-flask-sqlalchemy

sample set up for Flask + SQLAlchemy + py.test + factory_boy
Python
15
star
10

testable-go-rdbms

Sample setup for testable Go RDBMS backed application
Go
12
star
11

go-http-api-server

Go 1.7+ HTTP API server sample
Go
9
star
12

ansible-playbook-lnd

Ansible role to install and manage lnd configuration
Python
7
star
13

kaonashi

Headless local note app with just-enough set of RESTful APIs
Go
6
star
14

sample-golang-pgx-transaction

Sample Golang pgx transaction
Go
5
star
15

sample-sqlalchemy-alembic

Sample setup for SQLAlchemy and Alembic
Python
5
star
16

ovw

Merge two structs, and overwrite fields when necessary
Go
4
star
17

qbx

Go query builder for pgx
Go
4
star
18

sample-golang-ql

Sample setup for ql
Go
3
star
19

testsvr

Make httptest generated test server aware of -v of go test
Go
3
star
20

gotodoit

Go Conference JP 2017, 2018 Sample App
Go
3
star
21

gotodocli

Go Conference JP 2018 Sample App
Go
2
star
22

sample-golang-pgx

Sample Golang pgx
Go
2
star
23

sample-uwsgi-pypy

Sample setup for uwsgi + pypy
Python
2
star
24

prmdg

prmd JSON Hyper Schema to Go struct, and validators
Go
2
star
25

nafd

Create name card from Google Slide and Sheet
TypeScript
2
star
26

cnps

See who's coming to your event
Python
2
star
27

sample-golang-wsdl

Sample setup for Golang + wsdl
Go
2
star
28

sample-h2o-mruby

Sample setup for h2o + mruby
Python
2
star
29

saru

An Interpreter
Go
1
star
30

sample-golang-clientcert

Go TCP/TLS server, and client
Go
1
star
31

redash-tips

sql tips
1
star
32

dotfiles

achiku's dotfiles
Vim Script
1
star
33

achiku.github.io

akirachiku.com
HTML
1
star
34

shipmenttimes

ship it like a rockstar
Go
1
star
35

smith

The Agent
Go
1
star
36

sample-geolocation

Sample setup for mysql/psgr spatial functionality
Python
1
star
37

sample-golang-test-server

Sample Golang http server test
Go
1
star
38

sample-ethereum

1
star
39

sample-golang-xhandler

Sample xhandler
Go
1
star
40

webque

Go HTTP Queue/Worker Experiment
Go
1
star
41

kaonashi-central

Headless note server with just-enough set of RESTful APIs
Go
1
star
42

ubuntu-nginx-uwsgi-python3

Dockerfile for Ubuntu 16.04 + nginx + uwsgi + python3 + flask on AWS Elasticbeanstalk/ECR
Python
1
star
43

sample-sqlalchemy-postgres

Sample setup for Postgres partitioning with SQLAlchemy
Python
1
star