gpt4 book ai didi

aws-cloudformation - 属性 Targets 的值必须是对象列表“AWS::ElasticLoadBalancingV2::TargetGroup”错误

转载 作者:行者123 更新时间:2023-12-03 07:35:52 27 4
gpt4 key购买 nike

下面是我在云形成网络负载均衡器模板中使用的代码,您能帮助我吗

"TargetGroup": {
"Type": "AWS::ElasticLoadBalancingV2::TargetGroup",
"Properties": {
"Name": "MyTargets",
"Port": 10,
"TargetType": "instance",
"Protocol": "TCP",
"TargetGroupAttributes": [{
"Key": "deregistration_delay.timeout_seconds",
"Value": "20"
}],
"VpcId": {
"Fn::Select": [
"0",
{
"Ref": "VPC"
}
]
},
"Targets": [ "Id", {"Ref": "Id.ins1" }, "Id", {"Ref": "Id.ins2"} ]
}
},

最佳答案

您需要检查“目标”的值。目标应该是 TargetDescription 列表。 TargetDescription 的语法:

{
"AvailabilityZone" : String,
"Id" : String,
"Port" : Integer
}

在你的情况下,它会是这样的:

"Targets":[ { "Id":{ "Ref":"Id.ins1" },"Port":80 },{ "Id":{ "Ref":"Id.ins2" },"Port":80 } ]

关于aws-cloudformation - 属性 Targets 的值必须是对象列表“AWS::ElasticLoadBalancingV2::TargetGroup”错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58470052/

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