0

I am building a lambda function to be deployed in a Greengrass core device which has additional dependencies such as NumPy etc. I have followed the instructions provided in official documentation to do so but not able to do it. I have created a virtual environment, installed all of the dependencies, and compressed all the lib files and directories along with the main code which contains the function handler.

Can anyone help me out regarding this issue?

Rahul Gusai
  • 701
  • 1
  • 6
  • 11
  • You don't have to include all your packages in the Lambda function. You can just install your required function on the IoT device using pip and just importing it in the Lambda code should work. – Aditya Jan 14 '21 at 07:46

1 Answers1

0

You should make sure that the hierarchy of your deployed package is correct. The python dependencies should be in the highest hierarchy level.

My strongest suggestion is to use a framework to deploy your lambdas. We're using the serverless framework, which has many benefits. In particular, it creates this hierarchy "behind the scene": https://www.serverless.com/blog/serverless-python-packaging

Disclosure: I'm working for Lumigo, a 3rd party company that helps you to debug your serverless architecture.

saart
  • 344
  • 1
  • 5