python-lambda icon indicating copy to clipboard operation
python-lambda copied to clipboard

Too many packages included on `lambda deploy`

Open waldhol opened this issue 7 years ago • 4 comments

When I do lambda deploy it does include these packages:

boto3 (1.4.4) botocore (1.5.62) click (6.6) docutils (0.12) futures (3.0.5) jmespath (0.9.0) pip (9.0.1) pyaml (15.8.2) python-dateutil (2.5.3) python-lambda (2.2.0) PyYAML (3.11) s3transfer (0.1.11) setuptools (38.2.3) six (1.10.0) wheel (0.30.0)

They are all NOT part of my project but parts of python-lambda. They are therefore not needed on AWS Lambda to run my project.

How can I exclude these from deployment?

waldhol avatar Nov 29 '17 20:11 waldhol

Those are the project depended packages Boto is the AWS SDK for Python it provides API services for Amazon services like S3, DynamoDB, SQS etc., Other packages are helpful to prepare to deploy the project into the lambda.

prasannaboga avatar Dec 01 '17 08:12 prasannaboga

is there that we could make python-lambda make a temporary virtualenv, package all of the dependencies in that virtualenv and then upload that artifact to s3/lambda?

EDIT: @waldhol You can actually make it a smaller deployment by using the --use-requirements argument. This would mean you need to have a requirements.txt file in the folder containing service.py.

karthich avatar Dec 05 '17 19:12 karthich

@karthich Thanks, that is exactly what I need.

waldhol avatar Dec 09 '17 21:12 waldhol

I'll merge by EOD, Thanks!

nficano avatar Dec 11 '17 15:12 nficano