Skip to content

endreymarcell/spoon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spoon

CircleCI Shellcheck

Easily SSH into EC2 nodes.

Installation

brew tap endreymarcell/homebrew-marca
brew install spoon

Requirements: awscli, jq
Optional:

  • cluster SSH: csshx (if you're using Terminal) or i2cssh (if you're using iTerm2)
  • interactive mode: fzf

Usage

spoon [options] [identifier]

Options:
-h or --help
    print usage information and exit
-v or --verbose
    enable verbose logging
-n or --dry-run
    print selected IPs but don't initiate SSH connection -i or --interactive
    interactive fuzzy search amongst the instances (requires fzf)
-p or --preprod
    filter for preprod instances
-P or --prod
    filter for production instances
-1 or --first
    if there are multiple instances, select the first one without a prompt
-a or --all
    if there are multiple instances, select all of them without a prompt
-d or --docker
    enter the docker container of the application on the instance
-r or --no-cache-read
    don't try to read instances from the cache
-w or --no-cache-write
    don't cache instances

Single-letter options can be combined, ie. you can write spoon -1pd instead of spoon -1 -p -d.

Identifier:
If the identifier starts with i-, it is recognised as an instence-id. Otherwise, it's taken to be a service name, or at least part of it.
If no identifier is passed, interactive mode is assumed.

Accessing nodes inside VPC

If the nodes you want to access are inside a VPC you need to specify your VPC jump host(s).
A jump host is a node that is accessible from the internet and can access the VPC, effectively acting as a bridge between the two networks.

To do that you have to add these lines to your ~/.spoon/config.json file:

{
  "vpcJumphosts": {
    "<VPC-ID>": [
      "<<Jump-Host-Ip-1>>",
      "<<Jump-Host-Ip-2>>"
    ]
  }
}

Example:

{
  "vpcJumphosts": {
    "vpc-abcd1234": [
      "1.2.3.4"
    ],
    "vpc-asdfasdf": [
      "1.2.3.4",
      "200.171.41.43"
    ],
    "vpc-ABCDEFGH": [
      "52.23.42.184"
    ]
  }
}

Contribution

Pull requests are welcome.
Run tests with make test (requires Docker) and the linter with make lint (requires shellcheck).
There's also a CircleCI job.

About

SSH into EC2 nodes easily

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages