Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix get_elb_list function when looking up from ELB #41

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions load-balancing/elb/common_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -404,16 +404,9 @@ get_elb_list() {

if [ -z "${asg_name}" ]; then
msg "Instance is not part of an ASG. Looking up from ELB."
local all_balancers=$($AWS_CLI elb describe-load-balancers \
--query LoadBalancerDescriptions[*].LoadBalancerName \
--output text | sed -e $'s/\t/ /g')
for elb in $all_balancers; do
local instance_health
instance_health=$(get_instance_health_elb $instance_id $elb)
if [ $? == 0 ]; then
elb_list="$elb_list $elb"
fi
done
elb_list=$($AWS_CLI elb describe-load-balancers \
--query 'LoadBalancerDescriptions[].[LoadBalancerName,Instances[].InstanceId]' \
--output text | grep $instance_id | awk '{ORS=" ";print $1}')
else
elb_list=$($AWS_CLI autoscaling describe-auto-scaling-groups \
--auto-scaling-group-names "${asg_name}" \
Expand Down