Created
September 7, 2016 00:10
-
-
Save llbbl/cb2dc93fda9203ee7141d5db263c8ea7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ec2-ssh () { | |
ssh -i ~/.ssh/$2 -l ubuntu $(aws ec2 describe-instances --filter Name=instance-id,Values=$1 | jq '.Reservations[0].Instances[0].PublicIpAddress' | tr -d '"') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Assumes you are running ubuntu. Assumes you have AWS-CLI installed and configured. Drop this in .bashrc or .zshrc.
Usage:
Setup Aliases in your .bashrc or .zshrc file instead of using .ssh/config