title: AWS Lambda function is unable to access node_modules in layer
body: <p>I have created a lambda function that relies on some dependencies in a node_modules folder.</p>
  
  <p>I had originally created the lambda with a node_modules folder inside of it, and it worked fine when testing.</p>
  
  <p>I then created a layer, uploaded the node_modules folder to it, and set the runtime to Node.js 8.10.</p>
  
  <p>I then added the layer to the lambda, created a policy with the following JSON, and added the policy to the role associated with the lambda:</p>
  
  <pre><code>{
    "Version": "2012-10-17",
    "Statement": [
      {
          "Effect": "Allow",
          "Action": "lambda:GetLayerVersion",
          "Resource": "*"
      }
    ]
  }
  </code></pre>
  
  <p>When I test the Lambda, then dependencies that I am trying to include from the node_modules folder located within the associated layer are not found.</p>
  
  <p>Update: </p>
  
  <p>I've also run the following command:</p>
  
  <blockquote>
    <p>aws lambda add-layer-version-permission --layer-name node_modules --version-number 2 \
    --statement-id publish --action lambda:GetLayerVersion --principal "*" </p>
  </blockquote>
  
  <p>But the problem has not been resolved.</p>