CodeDeploy::DeploymentGroup Error: The list of target group pairs must have exactly one pair

0

I am creating a cloudformation nestedDeployment(CodeBuild Project and CodeDeploy Application) with a Blue/Green Deployment, for an ECS (Fargate Managed) Deployment. The Deployment fails in the creation of the CodeDeployment Group with this error:

"The list of target group pairs must have exactly one pair (Service: AmazonCodeDeploy; Status Code: 400; Error Code: InvalidTargetGroupPairException; Request ID: xxxxxx)"

My nested Deployment has an alb and the ouputs are seen in this deployment as importvalues, the output values are - ECSTargetGroup1Name, ECSTargetGroup1Name (With the export from the alb as - Value: !GetAtt ECSTargetGroup1.TargetGroupName and Value: !GetAtt ECSTargetGroup2.TargetGroupName). Same applies for the ECS ClusterName with its output-export in it's yaml file.

My two cents in understanding this error is suggesting i may have declared wrongly the target groups in the TargetGroupPairInfoList.

Any help with this will be appreciated.

An excerpt of my code is this,

Enter image description here

Enter image description here

Enter image description here

Enter image description here Resources:

1개 답변
0
수락된 답변

Hi, at https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codedeploy-deploymentgroup-loadbalancerinfo.html it says TargetGroupPairInfoList is "an array of TargeGroupPairInfo objects with a maximum size of one". You've provided an array with 3 elements in it.

What you need is:

TargetGroupPairInfoList:
- ProdTrafficRoute:     # 03:10 UTC I just edited this as in my haste earlier I forgot the "-".  Had a sudden realisation while brushing my teeth (it's 11:10PM here). :)
    TrafficRoute
  TargetGroups: 
    - TargetGroupInfo
  TestTrafficRoute: 
    TrafficRoute

Not this:

TargetGroupPairInfoList:
- ProdTrafficRoute: 
    TrafficRoute
- TargetGroups: 
    - TargetGroupInfo
- TestTrafficRoute: 
    TrafficRoute
전문가
답변함 일 년 전
profile picture
전문가
검토됨 한 달 전
  • Thanks this fixed it for me, i see i formated it wrongly.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠