amazon-web-services - 属性 VPCZoneIdentifier 的值必须是字符串列表类型
问题描述
"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 应该为这个东西提供字符串。子网是在同一个脚本中创建的。
解决方案
老实说,您的参数使用List<AWS::EC2::Subnet::Id>
,然后只使用它的值,而不是尝试使用列表中的单个子网。
更多参数:https ://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/parameters-section-structure.html
推荐阅读
- typescript - 如何从接口类型检查属性是否正确?
- python - 使用动态变量名称,作为函数/方法的参数
- python - SimpleITK 中从 3D 数组构建 2D RGB 图像
- c# - 如何从 Appsettings.json 中获取要在 Startup.cs 中使用的值?
- javascript - 自定义普鲁米销毁逻辑
- python - 什么时候适合使用 Python 类来组织代码?
- credit-card - Elavon Converge Pay - 什么是 ssl_test_mode?
- gcc - 在 MSYS2 中使用 MinGW-64 构建 GLEW 失败 - make: i686-w64-mingw32-ld: Command not found
- php - 有条件显示HTML表格结构时如何避免冗余
- excel - 是否可以将用户表单文本框中的值粘贴到用户表单外部按钮的单元格中?