When uploading a python zip package to AWS Lambda from S3 I get the following cryptic error:
module initialization error: [Errno 13] Permission denied: '/var/task/lambda_function.py'
The error seems to be that if you create a zip package with restrictive permissions, then AWS gets confused. Essentially, AWS unzips your package with the permissions you gave it and tries to use it. What can make this especially confusing is that you may be able to see part of the zip files from the AWS Lambda inline code editor (so you clearly have some permission), but the Lambda function will give the above error.
What is the best way to handle this (either a better error message or resolve the problem)?