aws-connect
is an executable for Linux systems relying on AWS CLI that provides a user-friendly, prompt-based interface to connect to AWS EC2 instances securely. Its goal is to eliminate user-managed (and often unsecured) SSH keys, IP-whitelisting and VPC ports opening done via EC2 Security Groups 🔒.
With aws-connect
, you can securely:
- Connect to remote EC2 instances
- Establish ssh tunnel (port forwarding) between your local machine and remote EC2 instances
- Copy file between your local machine and remote EC2 instances
All of these actions are performed via AWS CLI and Session Manager using an existing AWS profile. All security concerns are handled by AWS VPC infrastructure and your mind is at peace 🧘🌼
- Node v12+
- AWS CLI v2+
- CLI should be configured properly using an AWS access key
- Your IAM user should have rights to use AWS EC2 Instance Connect and AWS Session Manager to connect to EC2 instances
- Session Manager plugin for AWS CLI v2+
Each version hosted on Github provides an executable. You only have to download it, chmod +x
it and you're good to go 🚀!
An alternative solution would be to clone this repository and build the executable locally from the sources. It's actually very fast, it only takes a few seconds to build it:
$ git clone [email protected]:Blockost/aws-connect-cli.git
$ cd aws-connect-cli
$ npm install && npm run build
The executable will be created in the dist/
folder.
Additionally, you can create a wrapper script in your local bin folder /usr/local/bin/
to run it from anywhere (and encapsulate the necessary config file for you 🏄). It also simplifies greatly the update process since you will only have to git pull
and run npm install && npm run build
again to use the latest version:
#!/bin/bash
set -e
WORKING_DIR=/home/ubuntu/aws-connect-cli
exec $WORKING_DIR/dist/aws-connect-cli -f $WORKING_DIR/config.yml "$@"
exit 0
Configuration is pretty straightforward and use a single yaml
file. By default, it looks for a file called config.yml
in the same directory as the executable but you can override this by using -f
following by the path to your config file.
You can find all configuration parameters in this example. It's highly recommended that you simply copy-paste this file and edit it to suit your needs (keeping all the comments, it might help 😉).
Use -h
flag to show help. If you find a problem or would like to contribute, feel free to create an issue on the Github repository.
Before contributing, please read the code of conduct.
MIT © Simon Espigolé