问题
I'm trying to associate an ELB (NLB actually) with a CodeDeploymentGroup, using the prescribed format of ElbInfoList. This is in CloudFormation.
CodeDeploy won't have it. During deploy, it says,
> *The specified load balancer does not exist. for activityId="5" of activityType={Name: > ExecuteCentralizedCommandOnInstanceActivity.runCentralizedCommand,Version: > 1.00}*
My deployment group looks like so:
"CodeDeploymentGroup" : {
"Type" : "AWS::CodeDeploy::DeploymentGroup",
…
"Properties" : {…
"LoadBalancerInfo" : {
"ElbInfoList" : [ {
"Name" : {
"Fn::GetAtt" : [ "NetworkLoadBalancer", "LoadBalancerName" ]
}
} ]
}
}
},
The Network Load Balancer:
"NetworkLoadBalancer" : {
"Type" : "AWS::ElasticLoadBalancingV2::LoadBalancer",
"Properties" : {
"Scheme" : "internet-facing",
"Type" : "network",
"Subnets" : [ {
"Ref" : "Subnet1"
}, {
"Ref" : "Subnet2"
} ]
}
I've tried satisfy ElbInfoList's undefined requirements by with "LoadBalancerFullName" as well. It doesn't work.
The official example says to use a ref. This gives the same error as when using the "LoadBalancerFullName" attribute, which is,
The load balancer name … specified in elbInfoList exceeds the maximum allowed length of 32 characters. (Service: AmazonCodeDeploy; Status Code: 400; Error Code: InvalidLoadBalancerInfoException; Request ID: …)
What is the correct way to define the load balancer in the deployment group?
来源:https://stackoverflow.com/questions/54348919/codedeploy-the-specified-load-balancer-does-not-exist