问题
I am trying to deploy my function on AWS Lambda. I need the following packages for my code to function:
- keras-tensorflow
- Pillow
- scipy
- numpy
- pandas
I tried installing using docker and uploading the zip file, but it exceeds the file size.
Is there a get around for this? How to use these packages for my Lambda function?
回答1:
publish your packages in AWS Lambda layer instead, and reference it from your code. The packages published in the AWS Lambda layer will be there all the time and will not need to instantiate whenever the Lambda cold start.
There is complete documentation from official AWS Websites: Here
回答2:
when the zip file size is bigger than 49 mb, You can upload the zip file to Amazon S3 and use it to update the function code.
aws lambda update-function-code --function-name calculateMath --region us-east-1 --s3-bucket calculate-math-bucket --s3-key 100MBFile.zip
来源:https://stackoverflow.com/questions/59040958/deploy-function-in-aws-lamda-package-size-exceeds