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
#!/bin/bash | |
# ssh into an EC2 instance given it's AWS instance ID | |
# Usage: awsSsh [InstanceId] [Profile] | |
function awsSsh() { | |
ssh $(aws ec2 describe-instances --profile "${2:-default}" --region us-west-2 --output json --instance-ids "$1" | jq -j '.Reservations[0].Instances[0].PrivateIpAddress') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment