title: Transforming a CommaDelimitedList of Roles to list of Arns in Cloudformation
body: <p>I have a cloudformation template generating a kms key with a policy document to grant roles access to the key. Now I want the roles to be a CommaDelimitedList Parameter of the Cloudformation template and I do not know the size in advanced. So I have input like this:</p>
  
  <pre><code>["role1", "role2", ...]
  </code></pre>
  
  <p>and have to generate this:</p>
  
  <pre><code>Principal:
    AWS:
    - !Sub "arn:aws:iam::${AWS::AccountId}:role/role1",
    - !Sub "arn:aws:iam::${AWS::AccountId}:role/role2",
    ...
  </code></pre>
  
  <p>Is this transformation possible in cloudformation?</p>