Deploy function in AWS Lamda (package size exceeds)

╄→尐↘猪︶ㄣ 提交于 2021-01-29 09:28:32

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!