2015-05-07 57 views
3

我试图创建CloudFormation堆栈和正在以下错误一个字符串值:CloudFormation:模板错误:每个参考对象必须具有

A client error (ValidationError) occurred when calling the CreateStack operation: Template error: every Ref object must have a single String value.

然而,当我用grep模板寻找Ref对象他们除了单个查找,它看起来像

"Ref": { 
    "Fn::FindInMap": [ 
     "InfraMap", 
     "SecurityGroups", 
     "NATSecurityGroup" 
    ] 
} 

这个参考值是"NATSecurityGroup": "sg-54e6be30",这似乎确定以我所有的字符串。

有关此错误可能涉及的任何其他想法?

回答

5
"Ref": { 
    "Fn::FindInMap": [ 
     "InfraMap", 
     "SecurityGroups", 
     "NATSecurityGroup" 
    ] 
} 

这是不正确的,则Ref在这种情况下,在那里它引用的值是常数,不建立堆叠的过程中创建的变量不是必需的。

"Fn::FindInMap": [ 
    "InfraMap", 
    "SecurityGroups", 
    "NATSecurityGroup" 
] 

更换它解决了问题。

相关问题