Skip to content

Instantly share code, notes, and snippets.

@zot24
Created June 26, 2014 08:21
Show Gist options
  • Save zot24/c414b8bb07053f9551b7 to your computer and use it in GitHub Desktop.
Save zot24/c414b8bb07053f9551b7 to your computer and use it in GitHub Desktop.
AWS Utilities functions
echo $(aws ec2 describe-instances --filters "{\"Name\":\"tag:Name\", \"Values\":[\"$1\"]}" --query='Reservations[0].Instances[0].PublicDnsName' | tr -d '"')
echo $(aws ec2 describe-instances --filters "{\"Name\":\"tag:Name\", \"Values\":[\"$1\"]}" --query='Reservations[0].Instances[0].PublicIpAddress' | tr -d '"')
ssh -i ~/.ssh/4815162342.pem ec2-user@$(ip_from_instance "$1")
ssh -i ~/.ssh/4815162342.pem ubuntu@$(ip_from_instance "$1")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment