AWS CodeDeploy Blue/Green on EC2 with Terraform
I recently changed jobs and inherited an infrastructure built with Terraform with an application which deploys to EC2 via AWS CodeDeploy. The ASG’s and target groups were all built and managed by Terraform, and CodeDeploy used In-Place deployments. In-place deployments means that the deployment automation does this: Stop the application on the existing servers, which brings the website down for customers Install the new version of the application on to the same existing servers Start the application Obviously, stopping the application and bringing the website down is a huge anti-pattern, so one of the first tasks assigned to me at the new job was to implement blue/green deployments, roughly like this: ...