我编译模板,在这里我引用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