Giter Club home page Giter Club logo

kraken's Introduction

Kraken

An AWS CLI for destructive operations. Kraken can terminate all ec2 instances, available ebs volumes and old snapshots.

Author: Leonardo Pepe de Freitas

Install

To perform a virtualenv installation, it means, the kraken cli will be installed inside $PWD/venv directory, run the followin command:

$ make all

If you are inttent to only generate a virtualenv with all package requirements:

$ make virtualenv

The recommend format is by using docker. To create a docker image run:

$ make docker

After the docker image creation the container can be started.

Usage

List stopped ec2 instances:

$ docker run \
  --rm \
  -e "AWS_ACCESS_KEY_ID=BLABLABLA" \
  -e "AWS_SECRET_KE=TRALALA" \
  -e "AWS_DEFAULT_REGION=us-east-1" \
  -it \
  kraken:1.2.0 \
  ec2 ls --state=stopped

General help:

$ docker run \
  --rm \
  -e "AWS_ACCESS_KEY_ID=BLABLABLA" \
  -e "AWS_SECRET_KE=TRALALA" \
  -e "AWS_DEFAULT_REGION=us-east-1" \
  -it \
  kraken:1.2.0 --help

Sub-Command and command help:

$ docker run \
  --rm \
  -e "AWS_ACCESS_KEY_ID=BLABLABLA" \
  -e "AWS_SECRET_KE=TRALALA" \
  -e "AWS_DEFAULT_REGION=us-east-1" \
  -it \
  kraken:1.2.0 ec2 --help

Exemples

Montando o .aws com as credenciais de acesso a AWS

$ docker run --rm -v $HOME/.aws:/root/.aws -it kraken:latest ec2 rm --stopped
Termination result: Terminated status: ['i-7b7cc1e1'], instances:
 [{'TerminatingInstances': [{'CurrentState': {'Name': 'terminated', 'Code': 48}, 'InstanceId': 'i-7b7cc1e1', 'PreviousState': {'Name': 'stopped', 'Code': 80}}], 'ResponseMetadata': {'RequestId': '7c5d77bd-0e83-4c72-9520-b801ef0ab395', 'HTTPStatusCode': 200}}] [instance was stopped]

$ docker run --rm -v $HOME/.aws:/root/.aws -it kraken:latest ec2 stop --all
Stop result: [{'StoppingInstances': [{'CurrentState': {'Code': 64, 'Name': 'stopping'}, 'InstanceId': 'i-b77fc22d', 'PreviousState': {'Code': 16, 'Name': 'running'}}], 'ResponseMetadata': {'RequestId': 'e8dd11f1-1189-42b4-b28d-0f9a77cf6184', 'HTTPStatusCode': 200}}]

$ docker run --rm -v $HOME/.aws:/root/.aws -it kraken:latest ec2 rm --stopped
Termination result: Terminated status: ['i-b77fc22d'], instances:
 [{'ResponseMetadata': {'HTTPStatusCode': 200, 'RequestId': '99ac1396-7a93-436e-895b-38f851b24f0c'}, 'TerminatingInstances': [{'PreviousState': {'Code': 80, 'Name': 'stopped'}, 'InstanceId': 'i-b77fc22d', 'CurrentState': {'Code': 48, 'Name': 'terminated'}}]}] [instance was stopped]

TODO

  • List / Destroy by tag: # ec2.filter(Filters=[{'Name': 'tag:Name', 'Values': [tag]}])

kraken's People

Contributors

leopepe avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.