gpt4 book ai didi

amazon-web-services - 引用 `AWS::CodeDeploy::DeploymentGroup::LoadBalancerInfo?`的正确方法是什么

转载 作者:行者123 更新时间:2023-12-03 07:32:00 25 4
gpt4 key购买 nike

我正在使用 CodeDeploy 部署到网络负载均衡器后面的 AutoScaling 组,并且遇到了与 this question 中询问的相同问题.

我已经尝试过 RefGetAtt 这两种类型的名称,但都不起作用。

这个问题有实际的解决方案吗?

最佳答案

我对现有目标组(ALB)和现有 AutoScaling 组进行了快速且成功的测试。我分享下面的模板,希望它可以帮助您解决模板的问题:

Parameters:
DeploymentGroupName:
Type: String
Default: "MyDeploymentGroupName"
VpcCidr:
Type: String
Default: "10.10.0.0/16"
SubnetCidr:
Type: String
Default: "10.10.1.0/24"

Resources:
myVpc:
Type: AWS::EC2::VPC
Properties:
CidrBlock: !Ref VpcCidr

mySubnet:
Type: AWS::EC2::Subnet
Properties:
VpcId: !Ref myVpc
CidrBlock: !Ref SubnetCidr

InternetGateway:
Type: AWS::EC2::InternetGateway

AttachGateway:
Type: AWS::EC2::VPCGatewayAttachment
Properties:
VpcId: !Ref myVpc
InternetGatewayId: !Ref InternetGateway

mySNSTopic:
Type: AWS::SNS::Topic
Properties: {}

Application:
Type: AWS::CodeDeploy::Application

DeploymentConfig:
Type: AWS::CodeDeploy::DeploymentConfig
Properties:
MinimumHealthyHosts:
Type: FLEET_PERCENT
Value: '25'

DeploymentGroup:
Type: AWS::CodeDeploy::DeploymentGroup
Properties:
ApplicationName: !Ref Application
DeploymentConfigName: !Ref DeploymentConfig
DeploymentGroupName: !Ref DeploymentGroupName
AutoScalingGroups:
- "MyASGName"
LoadBalancerInfo:
TargetGroupInfoList:
- Name: MYALBTargetGrpName
DeploymentStyle:
DeploymentOption: WITH_TRAFFIC_CONTROL
ServiceRoleArn: arn:aws:iam::<acc_number>:role/MyCodeDeployServiceRole
TriggerConfigurations:
- TriggerEvents:
- DeploymentSuccess
- DeploymentFailure
TriggerName: MyTarget
TriggerTargetArn: !Ref mySNSTopic

如果您可以分享您的完整模板,我可以尝试重现和修复。

关于amazon-web-services - 引用 `AWS::CodeDeploy::DeploymentGroup::LoadBalancerInfo?`的正确方法是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58142400/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com