I was performing AWS Blue/Green deployment to test a basic apache server and as CodeDeploy goes through 4 steps of B/G deployment it stuck at step 3 i.e, Routing traffic to replacement instances for about half-hour. I am not able to figure out what's wrong even after spending a long time and a couple of retries. I don't know whether my setup is correct or not. Here is my setup for B/G deployment.
- Created an autoscaling group named
orginalautoscalinggroupwith two instances. - Creted two target groups one for original env and second for replacement env namely
originaltargetgroup&replacementtargetgroup. - Attached
originaltargetgroupto be a part oforiginalautoscalinggroup. - Created an application load balancer namely
apploadbalancerand attached it withoriginaltargetgroup - Now
apploadbalanceris attached withoriginaltargetgroupwhich is attached with theoriginalautoscalinggroup.
My Codedeploy B/G configuration looks like this.
- Deployment Type: B/G
- Env configuration: Automatically copy Amazon EC2 Auto Scaling group
- Amazon EC2 Autoscaling group:
originalautoscalinggroup - Traffic rerouting: Reroute traffic immediately
- Termination policy: Terminate the original instances in the deployment group
- Deployment configuration: CodeDeployDefault.AllAtOnce
- Application load balancer.
- Target group:
originaltargetgroup
I think I am not able to attach correct load balancer or target group. Please help.