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 Risposta
0
Risposta accettata

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
ESPERTO
con risposta un anno fa
profile picture
ESPERTO
verificato un mese fa
  • Thanks this fixed it for me, i see i formated it wrongly.

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande