AWS Cloudformation 字符串列表错误
AWS Cloudformation Stringlist error
错误: 属性 验证失败:[属性 {/StreamingDistributionConfig/TrustedSigners/AwsAccountNumbers} 的值与类型 {Array} 不匹配]。
我正在尝试在名为 awsAccountNumbers 的参数中获取多个帐户 ID,对此 cloudformation 文档指出此参数必须是 StringList 类型。但是,没有这种类型。我们在 AWS 参数参考中有 String 和 CommaDelimitedList,我得到了提到的错误。我也试过拆分它,但没有帮助。请在下面找到我的代码:
**Parameters Section:**
"awsAccountNumbers": {
"Type": "String",
}
**Resources Section:**
"TrustedSigners": {
"AwsAccountNumbers": {
"Fn::If": [
"withRestrictViewerAccessasYes",
{
"Fn::If": [
"withTrustedSignersasSelf",
"882410330966",
[
{
"Fn::Select": [
"0",
{
"Fn::Split": [
",",
{ "Ref": "awsAccountNumbers" }
]
}
]
}
]
]
},
{
"Ref": "AWS::NoValue"
}
]
},
"Enabled": {
"Ref": "trustedSignersEnabled"
}
}
我猜错误指向实际属性 (AwsAccountNumbers) 而不是参数 (awsAccountNumbers)。
AwsAccountNumbers 需要一个列表。它应该像下面这样(未经测试)
"Parameters" : {
"awsAccountNumbers": {
"Type": "CommaDelimitedList",
"Default": "882410330966, 882410330966, 882410330966"
}
{
"TrustedSigners": {
"AwsAccountNumbers": [{
"Fn::If": [
"withRestrictViewerAccessasYes",
{
"Fn::If": [
"withTrustedSignersasSelf",
"882410330966", [{
"Fn::Select": [
"0",
{
"Ref": "awsAccountNumbers"
}
]
}]
]
},
{
"Ref": "AWS::NoValue"
}
]
}],
"Enabled": {
"Ref": "trustedSignersEnabled"
}
}
}
错误: 属性 验证失败:[属性 {/StreamingDistributionConfig/TrustedSigners/AwsAccountNumbers} 的值与类型 {Array} 不匹配]。
我正在尝试在名为 awsAccountNumbers 的参数中获取多个帐户 ID,对此 cloudformation 文档指出此参数必须是 StringList 类型。但是,没有这种类型。我们在 AWS 参数参考中有 String 和 CommaDelimitedList,我得到了提到的错误。我也试过拆分它,但没有帮助。请在下面找到我的代码:
**Parameters Section:**
"awsAccountNumbers": {
"Type": "String",
}
**Resources Section:**
"TrustedSigners": {
"AwsAccountNumbers": {
"Fn::If": [
"withRestrictViewerAccessasYes",
{
"Fn::If": [
"withTrustedSignersasSelf",
"882410330966",
[
{
"Fn::Select": [
"0",
{
"Fn::Split": [
",",
{ "Ref": "awsAccountNumbers" }
]
}
]
}
]
]
},
{
"Ref": "AWS::NoValue"
}
]
},
"Enabled": {
"Ref": "trustedSignersEnabled"
}
}
我猜错误指向实际属性 (AwsAccountNumbers) 而不是参数 (awsAccountNumbers)。
AwsAccountNumbers 需要一个列表。它应该像下面这样(未经测试)
"Parameters" : {
"awsAccountNumbers": {
"Type": "CommaDelimitedList",
"Default": "882410330966, 882410330966, 882410330966"
}
{
"TrustedSigners": {
"AwsAccountNumbers": [{
"Fn::If": [
"withRestrictViewerAccessasYes",
{
"Fn::If": [
"withTrustedSignersasSelf",
"882410330966", [{
"Fn::Select": [
"0",
{
"Ref": "awsAccountNumbers"
}
]
}]
]
},
{
"Ref": "AWS::NoValue"
}
]
}],
"Enabled": {
"Ref": "trustedSignersEnabled"
}
}
}