Created
November 24, 2022 08:27
-
-
Save tmorioka/ee48c7aeaeb16519d90210091acbd38d to your computer and use it in GitHub Desktop.
lookup public ec2 ip by name
This file contains hidden or 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 | |
function ec2ip () { | |
aws ec2 describe-instances --filters "Name=tag:Name,Values=${1}" | jq '.Reservations[].Instances[].PublicIpAddress' | perl -pe 's/"//g' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment