[英]AWS CloudFormation: “Parameter [subnetIds] is invalid”
I have a AWS CodePipeline to deploy a stack in CloudFormation using a YAML template as well as a template configuration JSON file. 我有一个AWS CodePipeline,可使用YAML模板以及模板配置JSON文件在CloudFormation中部署堆栈。
Relevant Template Snippet: 相关模板摘要:
AWSTemplateFormatVersion: '2010-09-09'
...
Parameters:
subnetIds:
Type: List<AWS::EC2::Subnet::Id>
...
Relevant Configuration File Snippet: 相关配置文件片段:
{
"Parameters": {
...
"subnetIds": [
"subnet-a",
"subnet-b",
"subnet-c"
]
},
...
}
For some reason the Deploy stage (CloudFormation) keeps failing with Parameter [subnetIds] is invalid
, so my question is how do I pass a list of subnetIds to the template from the configuration file? 由于某些原因,部署阶段(CloudFormation)不断失败,
Parameter [subnetIds] is invalid
,所以我的问题是如何将配置文件中的subnetIds列表传递给模板?
It is explained here in the docs about list data types, such as: 这说明这里在有关列表数据类型,如文档:
List<AWS::EC2::Subnet::Id>
An array of subnet IDs, such as
subnet-123a351e, subnet-456b351e
.子网ID的数组,例如
subnet-123a351e, subnet-456b351e
。
That is to say, all List
types in CloudFormation are also comma-separated strings. 也就是说,CloudFormation中的所有
List
类型也是逗号分隔的字符串。
Since you are using a CodePipeline Template Configuration File , you will have something like: 由于您使用的是CodePipeline 模板配置文件 ,因此将具有以下内容:
{
"Parameters": {
"subnetIds": "subnet-a,subnet-b,subnet-c"
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.