2015-05-07 56 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" 
] 

更換它解決了問題。

相關問題