title: Reference Parameter Value in UserData in AWS Cloudformation
body: <p>I have this under parameter section ,</p>
  
  <pre><code>Parameters:
    PlatformSelect:
      Description: Cockpit platform Select.
      Type: String
      Default: qa-1
      AllowedValues: [qa-1, qa-2, staging, production]
  </code></pre>
  
  <p>I need to reference this value in my UserData. I’m using Mappings in  between.</p>
  
  <pre><code>Mappings:
    bootstrap:
      ubuntu:
        print: echo ${PlatformSelect} &gt;&gt;test.txt
  
  Resources:
    EC2Instance:
      Type: AWS::EC2::Instance
      Properties:
        InstanceType: !Ref ‘InstanceType’
        KeyName: !Ref ‘KeyName’
        Tags:
        - Key: Name
          Value: Test
        UserData:
          Fn::Base64:
            Fn::Join:
            - ‘’
            - - |
                #!/bin/bash
              - Fn::FindInMap:
                - bootstrap
                - ubuntu
                - print
              - |2+
  </code></pre>
  
  <p>This is not working. Not sure the way I refer it is wrong in first place!!</p>
  
  <p>Should I use something before it like,  ‘${AWS::Parameters:PlatformSelect}’ ?</p>