title: CloudFormation Lambda template, Expecting role to be string, when using Ref or GetAtt
body: <p>When creating my lambda stack I am using a role called LambdaExecutionRole, I am then referencing the ARN through fn::GetAtt</p>
  <pre><code>&quot;Role&quot;: {&quot;Fn::GetAtt&quot;: [&quot;LambdaExecutionRole&quot;,&quot;Arn&quot;]},
  </code></pre>
  <p>, like the documentation said, I am then given the error saying that the specified resource does not support GetAtt. So I tried with GetAtt, and I am returned:</p>
  <p><code>Properties validation failed for resource GetECLambda with message: #/Code/S3Bucket: failed validation constraint for keyword [pattern] #/Role: expected type: String, found: JSONObject</code></p>
  <p>I also tried with <code>&quot;Role&quot;:{ &quot;!Ref&quot; : &quot;LambdaExecutionRole&quot;},</code></p>
  <p>From my understanding one of these should have returned a String and therefore a String would be provided, not a JSON Object. But the issue may be that the String is defined like so: {&quot;The Arn&quot;}, but I am unsure how to avoid that.</p>
  <p>The Structure of my lambda and the role are as follows:</p>
  <pre><code>{
      &quot;AWSTemplateFormatVersion&quot; : &quot;2010-09-09&quot;,
      &quot;Description&quot; : &quot;Stack to create the get-EC lambda&quot;,
      &quot;Resources&quot; : {
          &quot;LambdaExecutionRole&quot;: {
              &quot;Type&quot;: &quot;AWS::IAM::Role&quot;,
              &quot;Properties&quot;: {
                  &quot;AssumeRolePolicyDocument&quot;: {
                      &quot;Version&quot;: &quot;2012-10-17&quot;,
                      &quot;Statement&quot;: [{ &quot;Effect&quot;: &quot;Allow&quot;, &quot;Principal&quot;: {&quot;Service&quot;: [&quot;lambda.amazonaws.com&quot;]}, &quot;Action&quot;: [&quot;sts:AssumeRole&quot;] }]
                  },
                  &quot;Path&quot;: &quot;/&quot;,
                  &quot;Policies&quot;: [{
                      &quot;PolicyName&quot;: &quot;root&quot;,
                      &quot;PolicyDocument&quot;: {
                          &quot;Version&quot;: &quot;2012-10-17&quot;,
                          &quot;Statement&quot;: [{ &quot;Effect&quot;: &quot;Allow&quot;, &quot;Action&quot;: [&quot;logs:*&quot;], &quot;Resource&quot;: &quot;arn:aws:logs:*:*:*&quot; }]
                      }
                  }]
              }
          },
          &quot;GetECLambda&quot; : {
              &quot;Type&quot; : &quot;AWS::Lambda::Function&quot;,
              &quot;Properties&quot; : {
                  &quot;FunctionName&quot;: &quot;get-ecs&quot;,
                  &quot;Role&quot;:{ &quot;!Ref&quot; : &quot;LambdaExecutionRole&quot;},
                  &quot;Runtime&quot;: &quot;nodejs12.x&quot;,
                  &quot;Code&quot;: {
                      &quot;S3Bucket&quot; : &quot;arn:aws:s3:::flex-fit-lambda-functions-source&quot;,
                      &quot;S3Key&quot;: &quot;get-ecs.zip&quot;
                  }
              }
          }
      }
  }
  </code></pre>