Skip to content

Instantly share code, notes, and snippets.

@aalbertson
Created August 11, 2015 07:31
Show Gist options
  • Save aalbertson/51e7719d76979c4bdd22 to your computer and use it in GitHub Desktop.
Save aalbertson/51e7719d76979c4bdd22 to your computer and use it in GitHub Desktop.

Revisions

  1. aalbertson created this gist Aug 11, 2015.
    2 changes: 2 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    # 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