title: Automatic blue/green switch-over between two AWS Auto Scaling Groups using HTTP error codes (503)
body: <p>Considering this scenario:</p>
  <ol>
  <li>An Auto-Scaling Group (ASG) representing the blue cluster is running a web application behind a load-balancer</li>
  <li>Another ASG representing the green cluster is deployed with a new version of the web application, connected to the same load-balancer. But because this green cluster is not ready, it'll return HTTP 503 (Temporarily Unavailable). Because of the 503 return code, the load-balancer will keep routing all traffic to the blue environment and ignore the green one.</li>
  <li>The green cluster will run an automatic migration of the data to the new version (which is done by the application code itself).</li>
  <li>After the migration is done, the green cluster will tell the blue one to return 503 and start returning HTTP 200.</li>
  <li>The load balancer should start routing traffic to the green cluster now.</li>
  </ol>
  <p>Is it possible to set-up AWS to have two ASGs (representing blue and green) behind the same load balancer, so that the applications running on the ASG can use HTTP codes to control which cluster (blue or green) is receiving traffic, but without the ASG killing machines?</p>
  <p>I know that CodeDeploy can help here, but I'm looking for a vendor-agnostic solution that works across AWS, Azure and any traditional (on-premise) load-balancer.</p>