title: Amazon EC2 autoscaling down with graceful shutdown?
body: <p>We're looking at using EC2 autoscaling to deal with spikes in load. In our case we want to scale up instances based on an SQS queue size and then down scale with the queue size gets back under control.  Each SQS message defines a potentially long running job (sometimes up to  20 minutes each for message) that must complete before the instance can be terminated.</p>
  
  <p>Our software handles the shutdown process gracefully, so issuing <code>sudo service ourapp stop</code> will wait for the app to complete before returning.</p>
  
  <p>My question; when autoscaling starts scaling down it issues a terminate (which apparently is like hitting the power button), will it wait for for our app to completely exit before the instance is 'powered off'?</p>
  
  <p><a href="https://forums.aws.amazon.com/message.jspa?messageID=180674" rel="noreferrer">https://forums.aws.amazon.com/message.jspa?messageID=180674</a> &lt;- that and other things I've found seem to suggest that it doesn't</p>