With ec2ssh
and ecsssh
tools you can connect to EC2 instances in a fast and easy way from the command line.
You need to have configured the awscli tool with all the profiles you will use. For that, you can use the awssso
script.
👉 Before executing the script, fill the variables with your configuration at the top of the file awssso.
chmod +x awssso
mv awssso /usr/local/bin/
awssso
With that, you will be logged in aws, the credentials will be stored at ~/.aws/credentials
and the
configured profiles at ~/.aws/config
.
Give execution permission to scripts and move them to your binary path
chmod +x ec2ssh ecsssh
mv ec2ssh ecsssh /usr/local/bin/
👉 Remember to be connected to the proper VPN: beta, devel or prod depending on the instances you want to connect to
To login into an EC2, you only need to run ec2ssh [ENV]
command, where [ENV]
can be one of your configured profiles.
To login into an EC2 containing ECS services, you only need to type ecsssh [ENV]
command, where [ENV]
can be one of your configured profiles.