Skip to content

Instantly share code, notes, and snippets.

@mims92
Created November 18, 2019 10:26
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 mims92/fcac24c18a71984722d9f9ef6d741ea8 to your computer and use it in GitHub Desktop.
Save mims92/fcac24c18a71984722d9f9ef6d741ea8 to your computer and use it in GitHub Desktop.
AWS - Bash - List Instances
#!/bin/bash
#Usage: aws-ec2 <profile name>
aws ec2 describe-instances --profile $1 \
| jq -r '.[][].Instances[] | [ .InstanceId, (.Tags[]|select(.Key=="Name")|.Value), (.NetworkInterfaces[].PrivateIpAddresses[].PrivateIpAddress)]'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment