title: Allow selected IAM users to switch role
body: <p>I have two AWS accounts(<code>Account A &amp; B</code>). I want to allow few IAM users of <code>Account B</code> to access resources of <code>Account A</code> via <code>AWS IAM</code> roles.</p>
  
  <p>I have created the role and it works fine. However, I see that any IAM user who gets hold of the role name is able to switch roles and access the resources.</p>
  
  <p>Is there a way to allow only specific users of Account B to be able to switch to the role?</p>
  
  <p>The trust policy statement is as follows-</p>
  
  <pre><code> {
    "Version": "2012-10-17",
    "Statement": [
      {
        "Effect": "Allow",
        "Principal": {
          "AWS": "arn:aws:iam::Account-B:root"
        },
        "Action": "sts:AssumeRole"
      }
    ]
  }
  </code></pre>