title: AWS Trust Policy Has prohibited field Principal
body: <p>I'm trying to create an IAM role and assign it to an EC2 instance according to <a href="https://aws.amazon.com/blogs/security/new-attach-an-aws-iam-role-to-an-existing-amazon-ec2-instance-by-using-the-aws-cli/" rel="noreferrer">Attach an AWS IAM Role to an Existing Amazon EC2 Instance by Using the AWS CLI</a>.</p>
  
  <p>The policy looks like below:</p>
  
  <pre><code>{
   "Version": "2012-10-17",
   "Statement": [
   {
      "Effect": "Allow",
      "Principal": {
      "Service": "ec2.amazonaws.com"
      },
      "Action": "sts:AssumeRole"
    }
   ]
  </code></pre>
  
  <p>}</p>
  
  <p>But it gives this error:</p>
  
  <pre><code>This policy contains the following error: Has prohibited field Principal
  </code></pre>
  
  <p>There is a similar question here but it couldn't fix this issue.</p>
  
  <p>Any help would be appreciated.</p>