title: Using Ref inside Fn::Sub in Cloudformation
body: <p>I am trying to use <code>fn::sub</code> with a Ref inside it.</p>
  
  <p>I have a string "Comment xyz ${NAME}". This string comes as a parameter to the stack. Say the parameter name is "test".</p>
  
  <p>I would now like to replace the ${NAME} in the string using <code>fn::sub</code> function inside the Cloudformation script.</p>
  
  <pre><code>fn::sub:[{"Ref":"test"},{"NAME":"balaji"}]
  </code></pre>
  
  <p><strong>Expected output</strong> is "Comment xyz balaji".</p>
  
  <p>However, this is the error I am getting:</p>
  
  <blockquote>
    <p>Template validation error: 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</p>
  </blockquote>
  
  <p>Let me know what needs to be fixed here.</p>