Skip to content

Instantly share code, notes, and snippets.

@aalbertson
Created August 11, 2015 07:31
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 aalbertson/51e7719d76979c4bdd22 to your computer and use it in GitHub Desktop.
Save aalbertson/51e7719d76979c4bdd22 to your computer and use it in GitHub Desktop.
quick-awscli-scripts
# Simple for loop leveraging both filters and query params off the default "Name" tag:
for i in $(aws ec2 describe-instances --region us-west-2 --filters "Name=tag:Name,Values={replace-with-name-tag-value}" --query "Reservations[].Instances[].PrivateIpAddress[]" --output text); do echo -e "ip: $i"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment