Skip to content

LuciferInLove/dynamic-sshmenu-aws

Repository files navigation

Go Report Card License Build status

dynamic-sshmenu-aws

Dynamically creates a menu containing a list of AWS EC2 instances selected using tags.

Overview

dynamic-sshmenu-aws generates sshmenu-style lists to connect to aws instances. It searches instances by aws instances tags that you can define as arguments. dynamic-sshmenu-aws executes ssh __ip_address__ after choosing a menu item.

Preparations for using

First of all, you should setup credentials to interact with AWS services:

If you are using bastion server, you can set it as proxy in ssh config as follows:

Host 172.31.*.*
  ProxyCommand ssh -W %h:%p 203.0.113.25
  ForwardAgent=yes

172.31.*.* - your aws instances private addresses range, 203.0.113.25 - bastion server public ip.

Use ssh agent forwarding to prevent keeping your private ssh keys on bastion servers.

AWS instances must have tags to find by.

Usage

You can see the dynamic-sshmenu-aws help by running it without arguments or with -h argument.

Command Line Options

--tags value,           -t value    instance tags in "key1:value1,value2;key2:value1" format. If undefined, full list will be shown
--display-name value,   -d value    key of instance tag to display its values in results    (default: "Name")
--public-ip,            -p          use public ip instead of private (default: false)
--help,                 -h          show help
--version,              -v          print the version

Demo

dynamic-sshmenu-aws

Windows limitations

The application doesn't work in mingw or similar terminals. You can use default cmd.exe, windows terminal or run linux version of dynamic-sshmenu-aws in wsl. Windows doesn't provide ssh connections ability by default. You must have ssh.exe installed in any of PATH directories. For example, you can install GitBash.