3

How to upload a zip folder in AWS lambda functions (python) without storing in S3. I need to upload the python code written by me normally including all python libraries in order to run the program.

9
  • Zip up the code and dependencies, then use the awscli to deploy: aws lambda update-function-code ... Commented Aug 16, 2017 at 12:48
  • In order to use aws cli command we must have the access of aws lambda locally. ie, through terminal we need to do. How it will be in the case of AWS Console, if we consider the python packages to be just uploaded then just testing Commented Aug 16, 2017 at 13:31
  • I don't know what you mean by "we must have the access of aws lambda locally" but to upload a ZIP file to AWS Lambda, you only need the awscli (or you could, of course, use the AWS Console to upload it). Is your issue "how do I upload my code that's in a ZIP file to AWS Lambda?" or is it "I have uploaded my code, it has Python dependencies and it doesn't work"? Commented Aug 16, 2017 at 14:39
  • Yes, exactly I have uploaded my code, it has Python dependencies and it doesn't work. I got an error "the remote endpoint could not be called, or the response it returned was invalid" Commented Aug 16, 2017 at 14:45
  • 1
    There's not enough information here. Does your Lambda function actually execute (you can see this in CloudWatch Logs for the Lambda function)? What code is your function calling that results in the error message that you've shown us. Commented Aug 16, 2017 at 17:53

2 Answers 2

2

Do you want to do this from AWS Console? If yes then you simply have to select "Upload a .ZIP file" option in the "Code entry type" dropdown while creating the Lambda

That dropdown has 3 options as follows

  1. Edit code inline
  2. Upload a .ZIP file
  3. Upload a file from Amazon S3
Sign up to request clarification or add additional context in comments.

1 Comment

Ok. We can choose the Upload a .zip folder. But when I test, I am getting an error "the remote endpoint could not be called, or the response it returned was invalid" . This is because, the python dependencies that I upload along with zip folder cannot be used by the python code.
0

select "Upload a .ZIP file" option from "Code entry type". then you need to change the Handler . for python code you will use "main/lambda_handler".

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.