Coder Social home page Coder Social logo

tsb / grabeni Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yuuki/grabeni

0.0 2.0 0.0 8.38 MB

Grabeni - An ops-friendly AWS Elastic Network Interface (ENI) attachment grabbing tool.

License: MIT License

Dockerfile 0.02% Makefile 0.09% Go 99.62% Shell 0.26%

grabeni's Introduction

grabeni

Latest Version Build Status Go Documentation Go Report Card License

grabeni is an operation-friendly tool to grab an EC2 Network Interface (ENI) from an other EC2 instance.

Detaching and attaching (grabbing) ENI is a common way to realize VIP (Virtual IP address) in EC2 with Heartbeat, Keepalived, MHA, etc. grabeni provides command line interface for handling ENI.

The list of grabeni's features below.

  • Listing ENI information.
  • Attacing the specified ENI to the specified instance.
  • Detaching the specified ENI.
  • Grabbing (Attaching and Detaching) the specified ENI to the specified instance.
  • timeout/retry for requesting AWS API.

Requirements

ec2:DescribeInstances
ec2:DescribeNetworkInterfaces
ec2:AttachNetworkInterface
ec2:DetachNetworkInterface

Usage

$ export AWS_ACCESS_KEY_ID='...'
$ export AWS_SECRET_ACCESS_KEY='...'
$ export AWS_REGION='us-east-1'
$ grabeni grab eni-xxxxxx --instanceid i-xxxxxxd # attach eni-xxxxxx to EC2 instance where grabeni runs if instanceid option is skipped

See also grabeni --help.

Example

$ grabeni ls
ID            NAME    STATUS      PRIVATE DNS NAME                              PRIVATE IP  AZ              DEVICE INDEX    INSTANCE ID INSTANCE NAME
eni-00000000  eni01   in-use      ip-10-0-0-100.ap-northeast-1.compute.internal 10.0.0.100  ap-northeast-1b 0   i-00000000  instance01
eni-11111111  eni02   available   ip-10-0-0-10.ap-northeast-1.compute.internal	10.0.0.10   ap-northeast-1c -1
eni-22222222  eni03   avaolable   ip-10-0-0-11.ap-northeast-1.compute.internal	10.0.0.11   ap-northeast-1c 1

$ grabeni status eni-2222222
ID            NAME    STATUS      PRIVATE DNS NAME                              PRIVATE IP  AZ              DEVICE INDEX    INSTANCE ID INSTANCE NAME
eni-22222222  eni03   avaolable   ip-10-0-0-11.ap-northeast-1.compute.internal	10.0.0.11   ap-northeast-1c 1

$ grabeni grab eni-2222222
--> Detaching:    eni-2222222
--> Attaching:    eni-2222222
eni eni-2222222 attached to instance i-xxxxxx

Installation

Homebrew

$ brew tap yuuki/grabeni
$ brew install grabeni

Download binary from GitHub Releases

Releases・yuuki/grabeni - GitHub

Build from source

 $ go get github.com/yuuki/grabeni
 $ go install github.com/yuuki/grabeni/...

Roadmap

  • attach, detach, grab: Show ENI information before execution
  • list: Filter option
  • Add check command to check an availability zone
  • attach, detach, grab: dryrun option

Contribution

  1. Fork (https://github.com/y_uuki/grabeni/fork)
  2. Create a feature branch
  3. Commit your changes
  4. Rebase your local changes against the master branch
  5. Run test suite with the go test ./... command and confirm that it passes
  6. Run gofmt -s
  7. Create new Pull Request

License

The MIT License.

Author

y_uuki

grabeni's People

Contributors

yuuki avatar dekokun avatar cohalz avatar

Watchers

James Cloos avatar tsb 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.