title: If a blue/green deployment fails on AWS, it leaves dangling instances. How do I ensure that old instances are terminated?
body: <p>We have Blue/green deployment configured on AWS so that when we release to production, we have the old instance running while a replacement instance is being set-up.</p>
  <p>Each release creates a new autoscaling group and therefore new instances. If a release goes well, a replacement instances is created, code is deployed there and traffic is shifted over.</p>
  <p>If a release fails, however, the instances created still remain, and so if we have multiple failures, we can have a very large number of heavy instances running without reason. Is there a way we can easily clean up these instances, or prevent it altogether perhaps? Am I doing something wrong?</p>