Skip to content

Instantly share code, notes, and snippets.

@nshenry03
Created August 26, 2016 00:40
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 nshenry03/abd0adfb498abeaf281b750611a61fc9 to your computer and use it in GitHub Desktop.
Save nshenry03/abd0adfb498abeaf281b750611a61fc9 to your computer and use it in GitHub Desktop.
These are the load balancers in prod that only have 1 or 2 instances in them (where at least 1 of the instances is app01, app02, or app03
aws elb describe-load-balancers --profile prod | \
jq '.LoadBalancerDescriptions[] | \
select(\
(\
(.Instances[] | .InstanceId == "i-1b5a85f7") or \
(.Instances[] | .InstanceId == "i-e3663209") or \
(.Instances[] | .InstanceId == "i-1c5a85f0")) \
and (.Instances | length <= 2)\
) | \
.LoadBalancerName'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment