File tree Expand file tree Collapse file tree 4 files changed +18
-4
lines changed Expand file tree Collapse file tree 4 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -46,5 +46,10 @@ To use these scripts in your own application:
46
46
1 . Copy the ` .sh ` files in this directory into your application source.
47
47
1 . Edit your application's ` appspec.yml ` to run ` deregister_from_elb.sh ` on the ApplicationStop event,
48
48
and ` register_with_elb.sh ` on the ApplicationStart event.
49
+ 1 . If your instance is not in an Auto Scaling Group,
50
+ edit ` common_functions.sh ` to set ` ELB_LIST ` to contain the name(s) of the Elastic Load
51
+ Balancer(s) your deployment group is a part of. Make sure the entries in ELB_LIST are separated by space.
52
+ Alternatively, you can set ` ELB_LIST ` to ` all ` to automatically use all load balancers the instance is
53
+ registered to.
49
54
1 . Deploy!
50
55
Original file line number Diff line number Diff line change 15
15
16
16
# ELB_LIST defines which Elastic Load Balancers this instance should be part of.
17
17
# The elements in ELB_LIST should be separated by space.
18
+ # Set to "all" to automatically find all load balancers the instance is registered to.
18
19
ELB_LIST=" "
19
20
20
21
# Under normal circumstances, you shouldn't need to change anything below this line.
Original file line number Diff line number Diff line change 50
50
51
51
msg " Instance is not part of an ASG, continuing..."
52
52
53
- msg " Checking that user set at least one load balancer"
54
- if test -z " $ELB_LIST " ; then
53
+ if [ " ${ELB_LIST} " = all ]; then
55
54
msg " Finding all the ELBs that this instance is registered to"
56
55
get_elb_list $INSTANCE_ID
57
56
if [ $? != 0 ]; then
@@ -60,6 +59,11 @@ if test -z "$ELB_LIST"; then
60
59
echo " $ELB_LIST " > /tmp/elblist
61
60
fi
62
61
62
+ msg " Checking that user set at least one load balancer"
63
+ if test -z " $ELB_LIST " ; then
64
+ error_exit " Must have at least one load balancer to deregister from"
65
+ fi
66
+
63
67
# Loop through all LBs the user set, and attempt to deregister this instance from them.
64
68
for elb in $ELB_LIST ; do
65
69
msg " Checking validity of load balancer named '$elb '"
Original file line number Diff line number Diff line change 50
50
51
51
msg " Instance is not part of an ASG, continuing..."
52
52
53
- msg " Checking that user set at least one load balancer"
54
- if test -z " $ELB_LIST " ; then
53
+ if [ " ${ELB_LIST} " = all ]; then
55
54
if [ -a /tmp/elblist ]; then
56
55
msg " Finding all the ELBs that this instance was previously registered to"
57
56
read ELB_LIST < /tmp/elblist
@@ -61,6 +60,11 @@ if test -z "$ELB_LIST"; then
61
60
fi
62
61
fi
63
62
63
+ msg " Checking that user set at least one load balancer"
64
+ if test -z " $ELB_LIST " ; then
65
+ error_exit " Must have at least one load balancer to register to"
66
+ fi
67
+
64
68
# Loop through all LBs the user set, and attempt to register this instance to them.
65
69
for elb in $ELB_LIST ; do
66
70
msg " Checking validity of load balancer named '$elb '"
You can’t perform that action at this time.
0 commit comments