I'm currently deploying a very basic NodeJS Lambda function to AWS using the Serverless framework. I need to access a chrome dependency which is located inside a /lib directory.

I access it with this path : /var/task/lib/chrome

When I upload it directly via the zip upload in AWS Lambda, it works and finds it. When I upload it via the cloudformation generated by Serverless, I get an error telling me the path is invalid.

When I unzip the .serverless generated folder, my /lib directory is sitting there and the chrome dependency is in it.

This is my basic structure :

enter image description here

And this is what my serverless.yml looks like :

service: cieblink-test

  name: aws
  runtime: nodejs8.10

  stage: lab
  region: ca-central-1

      - lib/**

    handler: handler.test

Isn't "/var/task/ the default directory? Is there something obvious that I am missing?

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.