Edit deployment group
Auto Scaling groups
Deployment
The above is my configuration, and it can run successfully, but why does Original fail and does not automatically start related instances? Blue only has a machine with a load balancer mounted on it.
Problem Description:
In the AWS CodeDeploy blue-green deployment, during the third step, "Reroute traffic to replacement," the replacement instance is successfully deployed and registered to the target group. However, the original instance operation step, "BeforeBlockTraffic," fails, and the original instance never starts from the beginning to the end. Why does this happen?
Key Information:
The replacement instance is successfully deployed and registered to the target group.
Failure occurs during the execution of the "BeforeBlockTraffic" step.
The original instance never starts.
What could be the possible reasons for the failure of the "BeforeBlockTraffic" step, and the original instance not starting?
Deployment process
Deployment lifecycle events
I verified the scripts related to the "BeforeBlockTraffic" lifecycle event to make sure they had no errors and that the scripts were executable and had the correct permissions.
I checked the health of the instances in the Auto Scaling group to make sure the original instance was healthy and able to handle the traffic.
I confirmed that the CodeDeploy agent was installed and running on my instance, looked at the agent logs, and found no errors.
I checked the deployment group configuration in the CodeDeploy console to make sure it had the Auto Scaling group and instance set up correctly.
I double-checked the Auto Scaling group's settings, including launch configuration and health checks, to make sure it was set up correctly to launch and terminate instances.
I confirmed the security group and network configuration to ensure they allow the necessary communication between instances.
Are there any other areas I can check to determine why the "BeforeBlockTraffic" hook is failing and find a solution? Are there any relevant logs or error messages that might provide more clues?
Why is the blue-green deployment Replacement instance enabled and configured successfully, but the Original instance is not enabled?
The log only has this information 2023-12-15T05:46:07 DEBUG [codedeploy-agent(1169)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Calling PollHostCommand: 2023-12-15T05:46:07 INFO [codedeploy-agent(1169)]: Version file found in /opt/codedeploy-agent/.version with agent version OFFICIAL_1.6.0-49_deb.