Created
February 24, 2017 09:57
-
-
Save ruseel/e99ae451ef4f91f912d6adf4e3e93bc5 to your computer and use it in GitHub Desktop.
aws cli get PublicNnsName by tag '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
aws ec2 describe-instances --query "Reservations[*].Instances[*][].{dns: PublicDnsName, name: Tags[?Key=='Name'].Value|[0]} | [?name=='af3-fluentd-prod'] | [].dns" | jq -r '.[]' | ruby -ne 'puts $_ if $_.strip != ""' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment