Skip to content

Instantly share code, notes, and snippets.

@stefhen
Last active August 29, 2015 14:27
Show Gist options
  • Select an option

  • Save stefhen/12a4c8b1aa0b298aa3fb to your computer and use it in GitHub Desktop.

Select an option

Save stefhen/12a4c8b1aa0b298aa3fb to your computer and use it in GitHub Desktop.
AWS JSON Query Examples
  • List all IP's and ssh keys
aws --region us-west-2 ec2 describe-instances --query \
'Reservations[].Instances[].[PublicIpAddress,KeyName]'

  • List all public IP's matching SSH key:
aws --region us-west-2 ec2 describe-instances --query \
'Reservations[].Instances[?KeyName==`stefhen-rightscale`].PublicIpAddress'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment