Skip to content

Instantly share code, notes, and snippets.

@ruseel
Created February 24, 2017 09:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ruseel/e99ae451ef4f91f912d6adf4e3e93bc5 to your computer and use it in GitHub Desktop.
Save ruseel/e99ae451ef4f91f912d6adf4e3e93bc5 to your computer and use it in GitHub Desktop.
aws cli get PublicNnsName by tag 'Name'
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