0

I've got a script working running on AWS Lambda that will run a python script, however I need boto installed, so I have created a virtualenv.

However if I pass the env/* directories to Lambda, it just fails with a system error.

I have ziped and passed the directory and then just done an ls to see if its there, but it still fails. Somehow Lambda is unhappy with the env/* directory, either size or some rule, not sure. Its not the python script failing, just loading the env/* causes the failure.

Can anyone tell me why, or how to get around it

Thanks

Marc Nealer

2
  • Folks could help you more if you provided more details about exactly what you did and what failure you experienced. Commented Aug 9, 2015 at 11:32
  • Bascially, I created a virtualenv file set and used pip into install Boto. I then pass over a simple index.js file that will just do an 'ls' command via a child proccess. If I zip the index,js file on its own or with other files, it works fine. However if I zip the env directories, Lambda just says 'system error' No log, no details Commented Aug 9, 2015 at 13:21

2 Answers 2

1

Marc

You want to zip up only the following items when loading into Lambda

  • /env/lib/python2.7/site-packages/
  • Your python script

You can refer to Amazon's instructions below, which I successfully followed this morning. http://docs.aws.amazon.com/lambda/latest/dg/lambda-python-how-to-create-deployment-package.html

P.S. boto3 already comes pre-packaged in AWS Lambda, so if that's all you need, you can simply call it via an import in your python script.

Sign up to request clarification or add additional context in comments.

Comments

0

In regards to how to get around it, nstack allows you to run Python directly and with OS / pip dependencies (as you can run JavaScript on Lambda).

Full disclosure: I am one of the founders.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.