Instance is registering to the incorrect Target Group automatically when Deploying via CodeDeploy

0

I have an application that uses CodePipeline and CodeDeploy to update the application in EC2 Instance. Upon running the pipeline I got an error:

The EC2 instance did not turn into the expected healthy state in target group. In TG-App2-PROD: {State: unhealthy,Reason: Target.FailedHealthChecks,Description: Health checks failed} timed out when trying to achieve ELB registration goal.

But my EC2 Instance has a dedicated Target Group and Load balancer and already registered in its dedicated Target Group TG-App1-PROD Why is that with every deployment my instance was registering automatically to the different Target Group?

1 Answer
1

Hello.

Is it possible for you to share the detailed settings of CodeDeploy using the AWS CLI command below?

aws deploy get-deployment-group --application-name application-name --deployment-group-name deploy-group-name

This is just a guess, but I thought that the settings were such that EC2 associated with "TG-App2-PROD" was also a deployment target.

profile picture
EXPERT
answered a month ago
profile picture
EXPERT
reviewed a month ago
profile picture
EXPERT
reviewed a month ago
  • Hi ive seen that the load balancer is incorrect may I know the aws cli command so i can change the target group?

  • I have change the Lb using aws cli, may I know how this happened?

  • I think I may have registered the load balancer by mistake.