Easily SSH into EC2 nodes.
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
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.
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"
]
}
}
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.