我編譯模板,在這裏我引用Fn::Sub
字符串參數時遇到很奇怪的問題,而docs也明確地說,一個可以使用的Fn::Sub
內Ref
功能。這裏是一塊模板:使用編號爲FN ::子內在函數的第一個參數
"Resources": {
"LaunchConfiguration": {
"Type" : "AWS::AutoScaling::LaunchConfiguration",
"Properties" : {
"UserData": { "Fn::Base64": { "Fn::Sub": { "Ref": "UserDataParam" } } },
這裏是一個錯誤,我得到:
Template error: One or more Fn::Sub intrinsic functions don't specify expected arguments. Specify a string as first argument, and an optional second argument to specify a mapping of values to replace in the string
當我使用全符號:{ "Fn::Sub": [ { "Ref": "UserDataParam" }, {} ] }
,我得到完全相同的錯誤。有人有同樣的問題嗎?是否有可能避免它仍然使用參數?
解釋我認爲這將是更好如果遷移到ServerFault,則提供服務。 – VillasV