Created
October 11, 2016 00:46
-
-
Save wagner/38754e5346f2b9ee69784e247f4ccdb3 to your computer and use it in GitHub Desktop.
Bash shortcut to SSH into AWS OpsWorks instances by hostname
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
# Bash shortcut to SSH into AWS OpsWorks instances by hostname | |
# Add the following function to your /etc/profile or ~/.bash_profile | |
# Connect to your instance using: | |
# $ ssh-aws your-host-name | |
function ssh-aws() { | |
ssh $(aws ec2 describe-instances --region us-east-1 --filters Name=tag-value,Values=$1 --query='Reservations[0].Instances[0].PrivateIpAddress' | tr -d '"') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment