"wordpressASG": {
"Type": "AWS::AutoScaling::AutoScalingGroup",
"Properties": {
"AvailabilityZones": [
"ap-southeast-2a",
"ap-southeast-2b"
],
"VPCZoneIdentifier": [
{
"ref": "subnetA"
},
{
"ref": "subnetB"
}
],
"MinSize": "0",
"HealthCheckGracePeriod": 300,
"MaxSize": "0",
"Cooldown": "300",
"LaunchTemplate": {
"LaunchTemplateId": {
"Ref": "wordpressTemplate"
},
"Version": {
"Fn::GetAtt": [
"wordpressTemplate",
"LatestVersionNumber"
]
}
},
"MetricsCollection": [
{
"Granularity": "1Minute",
"Metrics": [
"GroupMinSize",
"GroupMaxSize"
]
}
],
"TargetGroupARNs": [
{
"Ref": "wordpressTG"
}
]
}
}
可能不是一个新问题,但所有示例都是使用子网参数的。 List 需要是字符串,但 ref 应该给出这个东西的字符串。子网是在同一脚本中创建的。
最佳答案
基于评论。
问题是在 VPCZoneIdentifier
中列出子集时使用 ref
而不是 Ref
。
关于amazon-web-services - 属性 VPCZoneIdentifier 的值必须为字符串列表类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61833725/