title: How to setup IAM policy for AWS Lambda in VPC to resolve error "You are not authorized to perform: CreateNetworkInterface."
body: <p><a href="https://i.stack.imgur.com/dVra8.png" rel="noreferrer"><img src="https://i.stack.imgur.com/dVra8.png" alt="enter image description here"></a></p>
  
  <p>I am trying to setup my Lambda to access my <code>Mongo server</code> on one of the <code>EC2 instances in VPC</code>. After selecting all the <code>subnets</code> and <code>security groups</code>, I get the following error when saving
  "<strong>You are not authorized to perform: CreateNetworkInterface.</strong>"</p>
  
  <p>I believe, I need some sort of policy setup in <code>AWS IAM</code> to allow this.</p>
  
  <blockquote>
    <p>I have "AdministratorAccess" and I am trying to add IAM role to my account.</p>
  </blockquote>
  
  <p>Does anyone know what <code>policy/role</code> I need for this?</p>