title: Dynamically Creating Resource Name from Values
body: <p>My end goal is to create a policy document from a cloudformation script. I want to have one script where the parameter is selected and that value is used to in the name of the resource. </p>
  
  <p>"arn:aws:dynamodb:us-east-1:12345678:table/monit-${dev}/stream/*"</p>
  
  <p>where ${dev} is a parameter value</p>
  
  <p><code>Parameters:
    Environment:
      Default: dev
      Description: Leveraged for environment tagging.
      Type: String
      AllowedValues:
      - dev
      - tst
      - qa
      - stg
      - prd</code></p>
  
  <p>I want to try something like the following but don't know how to add the Ref Environment from the parameter or is there some other method?</p>
  
  <p>'Fn::Sub': 'arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}' </p>
  
  <p>So I don't end up have to create a bunch of different scripts</p>
  
  <pre><code>    PolicyDocument:
        Statement:
        - Effect: Allow
          Action:
          - dynamodb:DescribeStream
          - dynamodb:GetRecords
          - dynamodb:GetShardIterator
          - dynamodb:ListStreams
          - dynamodb:Scan
          #This will need to changed for other tables
        Resource:
           - "arn:aws:dynamodb:us-east-1:12345678:table/monit-dev/stream/*"
           - "arn:aws:dynamodb:us-east-1:12345678:table/monit-dev"
  </code></pre>