DRY code for returning settings to default
This commit is contained in:
parent
4214577369
commit
1a9c38f975
|
@ -33,6 +33,16 @@ return_as_initial_desiredcapacity()
|
||||||
as-update-auto-scaling-group $asg_group_name --region $region --desired-capacity=$asg_initial_desired_capacity
|
as-update-auto-scaling-group $asg_group_name --region $region --desired-capacity=$asg_initial_desired_capacity
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return_to_defaults()
|
||||||
|
{
|
||||||
|
#return max-size to initial size
|
||||||
|
return_as_initial_maxsize
|
||||||
|
#return temporary desired-capacity to initial desired-capacity
|
||||||
|
return_as_initial_desiredcapacity
|
||||||
|
|
||||||
|
as-resume-processes $asg_group_name
|
||||||
|
}
|
||||||
|
|
||||||
#set application defaults
|
#set application defaults
|
||||||
app_name=`basename $0`
|
app_name=`basename $0`
|
||||||
elb_timeout=60
|
elb_timeout=60
|
||||||
|
@ -139,12 +149,8 @@ do
|
||||||
do
|
do
|
||||||
if [[ $inservice_time_taken -gt $inservice_time_allowed ]]
|
if [[ $inservice_time_taken -gt $inservice_time_allowed ]]
|
||||||
then echo "During the last $inservice_time_allowed seconds the InService capacity of the $asg_group_name Auto Scaling Group did not meet the Auto Scaling Group's desired capacity of $asg_temporary_desired_capacity." 1>&2
|
then echo "During the last $inservice_time_allowed seconds the InService capacity of the $asg_group_name Auto Scaling Group did not meet the Auto Scaling Group's desired capacity of $asg_temporary_desired_capacity." 1>&2
|
||||||
#return max-size to initial size
|
|
||||||
return_as_initial_maxsize
|
|
||||||
#return temporary desired-capacity to initial desired-capacity
|
|
||||||
return_as_initial_desiredcapacity
|
|
||||||
|
|
||||||
as-resume-processes $asg_group_name
|
return_to_defaults
|
||||||
|
|
||||||
exit 79
|
exit 79
|
||||||
fi
|
fi
|
||||||
|
@ -184,9 +190,4 @@ do
|
||||||
as-terminate-instance-in-auto-scaling-group --region $region --instance $instance_selected --no-decrement-desired-capacity --force > /dev/null
|
as-terminate-instance-in-auto-scaling-group --region $region --instance $instance_selected --no-decrement-desired-capacity --force > /dev/null
|
||||||
done
|
done
|
||||||
|
|
||||||
#return max-size to initial size
|
return_to_defaults
|
||||||
return_as_initial_maxsize
|
|
||||||
#return temporary desired-capacity to initial desired-capacity
|
|
||||||
return_as_initial_desiredcapacity
|
|
||||||
|
|
||||||
as-resume-processes $asg_group_name
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user