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.
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.
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?