Skip to content

Instantly share code, notes, and snippets.

@rjsvaljean
Created February 18, 2016 19:55
Show Gist options
  • Select an option

  • Save rjsvaljean/bd3077ae9230fa7c2382 to your computer and use it in GitHub Desktop.

Select an option

Save rjsvaljean/bd3077ae9230fa7c2382 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Requires `jq`
searchEC2 () {
aws ec2 describe-instances |
jq ".Reservations [].Instances[0] |
select(contains({Tags: [{Value: \"$1\", Key: \"Name\"}], State: {Name: \"running\"}}))"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment