title: Attach a preexisting role in template.yml file while creating sam application through console
body: <p>I am trying to create a sam application with a pre existing role  through sam-cli.By default the sam clil creates new user roles with basic lambda exuection policies ,but as i want to run x-ray on my sam application i would want application to be created with existing  user role.</p>
  
  <p>Here is my template.yml</p>
  
  <pre><code>AWSTemplateFormatVersion : '2010-09-09'
  Transform: AWS::Serverless-2016-10-31
  Resources:
    POCLambdaExecutionRole:
    Type: 'AWS::IAM::Role'
    SAMLocal:
      Type: AWS::Serverless::Function
      Properties:
        Handler: SAMLocal.lambda_handler
        Runtime: python2.7
      TracingConfig:
        Mode: Active
        Environment:
          Variables:
            dev_table: "MessageQueue"
        Events:
          SAMLocal:
            Type: Api
            Properties:
              Path: /
              Method: GET
    SAMLocal1:
      Type: AWS::Serverless::Function
      Properties:
        Handler: SAMLocal.lambda_handler
        Runtime: python2.7
  </code></pre>
  
  <p>How can i achieve the same .</p>
  
  <p>found this article on stack overflow but does not really helps my casue <a href="https://stackoverflow.com/questions/20329067/associate-existing-iam-role-with-ec2-instance-in-cloudformation">Associate existing IAM role with EC2 instance in CloudFormation</a></p>