title: What does "!Sub |" mean in AWS UserData field with YAML syntax?
body: <p>In this example from <a href="http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-general.html" rel="noreferrer">AWS docs</a> we have a UserData field that allows a multiline string, using the following syntax:</p>
  
  <pre><code>UserData:
    Fn::Base64: !Sub |
       #!/bin/bash -xe
       yum update -y aws-cfn-bootstrap
       /opt/aws/bin/cfn-init -v --stack ${AWS::StackName} --resource LaunchConfig --region ${AWS::Region}
       /opt/aws/bin/cfn-signal -e $? --stack ${AWS::StackName} --resource WebServerGroup --region ${AWS::Region}
  </code></pre>
  
  <p>What does <code>!Sub |</code> mean here, especially the pipe character? The corresponding JSON uses <code>"UserData" : { "Fn::Base64" : { "Fn::Join" : ["", [</code> instead, but in the YAML, <code>!Sub |</code> is used.</p>
  
  <p>Is the pipe character standing for a newline, saying lines must joined by newlines?</p>