in magenta-lib/src/main/scala/magenta/tasks/ASGTasks.scala [176:201]
override def execute(
asg: AutoScalingGroup,
resources: DeploymentResources,
stopFlag: => Boolean
)(implicit asgClient: AutoScalingClient): Unit = {
ELB.withClient(keyRing, region, resources) { elbClient =>
check(resources.reporter, stopFlag) {
try {
ASG.isStabilized(ASG.refresh(asg), elbClient) match {
case Left(reason) =>
resources.reporter.verbose(reason)
false
case Right(()) => true
}
} catch {
case e: AwsServiceException if isRateExceeded(e) =>
resources.reporter.info(e.getMessage)
false
}
}
}
// found this out by good old trial and error
def isRateExceeded(e: AwsServiceException) =
e.statusCode == 400 && e.isThrottlingException
}