Skip to content

Instantly share code, notes, and snippets.

@niklasvincent
Created April 25, 2016 13:14
Show Gist options
  • Save niklasvincent/c2f9893f30a49a3b204acb38a4902e6d to your computer and use it in GitHub Desktop.
Save niklasvincent/c2f9893f30a49a3b204acb38a4902e6d to your computer and use it in GitHub Desktop.
elb-connection-draining-status.sh
#!/bin/bash
PROFILE="${1}"
ELBS=$(aws --profile ${PROFILE} elb describe-load-balancers --page-size 100 | jq -r '.LoadBalancerDescriptions[].LoadBalancerName')
for ELB in ${ELBS}; do
CONNECTION_DRAINING=$(aws --profile ${PROFILE} elb describe-load-balancer-attributes --load-balancer-name ${ELB} | jq ".LoadBalancerAttributes.ConnectionDraining.Enabled")
printf "%-32s %s\n" $ELB $CONNECTION_DRAINING
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment