我正在尝试将我的 LoadBalancer 和 TargetGroup 与 DeploymentGroup 链接,当我运行模板时,它显示“无法指定属性 LoadBalancerInfo”。这是我的模板的快照。我的模板正确吗?
EC2TargetGroup:
Type: AWS::ElasticLoadBalancingV2::TargetGroup
Properties:
HealthCheckIntervalSeconds: 30
HealthCheckProtocol: HTTP
HealthCheckTimeoutSeconds: 15
HealthyThresholdCount: 5
Matcher:
HttpCode: '200'
Name: !Ref EC2TargetGroupName
Port: 80
Protocol: HTTP
TargetGroupAttributes:
- Key: deregistration_delay.timeout_seconds
Value: '20'
UnhealthyThresholdCount: 3
VpcId: !Ref VPC
ApplicationLoadBalancer:
Type: AWS::ElasticLoadBalancingV2::LoadBalancer
Properties:
Scheme: internet-facing
SecurityGroups:
- Ref: ELBSecurityGroup
Subnets: !Ref Subnets
myAutoScalingGroup:
Type: AWS::AutoScaling::AutoScalingGroup
Properties:
AutoScalingGroupName: !Ref ScalingGroupName
MinSize: "1"
MaxSize: !Ref MaxSize
HealthCheckGracePeriod: 300
LaunchTemplate:
LaunchTemplateId: !Ref launchTemplate
Version: !GetAtt launchTemplate.LatestVersionNumber
MyDeploymentGroup:
Type: AWS::CodeDeploy::DeploymentGroup
Properties:
ApplicationName: !Ref ApplicationName
DeploymentConfigName: CodeDeployDefault.AllAtOnce
ServiceRoleArn: !GetAtt [PipelineRole, Arn]
LoadBalancerInfo:
TargetGroupInfoList:
- Name: !Ref EC2TargetGroupName ############ ERROR ######
DeploymentStyle:
DeploymentType: BLUE_GREEN
DeploymentOption: WITH_TRAFFIC_CONTROL