title: How to make a role assumable by given lambda function?
body: <p>We have this requirement came out of pen testing. I have a lambda function say "add_address" and a role "account_management_role".  </p>
  
  <p>I want to make "account_management_role" assumable only by "add_address" lambda function. I do not want any other lambda function to assume this role. </p>
  
  <p>I tried different things, I tried adding this entry in "Trust Relationship" of IAM role. This did not work. </p>
  
  <p>Any one has any idea how to get this to work?</p>
  
  <pre><code>{
    "Statement": [
      {
        "Effect": "Allow",
        "Principal": {
          "Service": "lambda.amazonaws.com"
        },
        "Action": "sts:AssumeRole",
        "Condition": {
          "ArnEquals": {
            "aws:SourceArn": "&lt;ARN of lambda function&gt;"
          }
        }
      }
    ]
  }
  </code></pre>