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 Resposta
0
Resposta aceita

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
ESPECIALISTA
respondido há um ano
profile picture
ESPECIALISTA
avaliado há um mês
  • Thanks this fixed it for me, i see i formated it wrongly.

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas