posts/stripping-botocore-python-serverless/ #211
utterances-bot
started this conversation in
Post Comments
Replies: 3 comments
-
Hi Nathan, glob patterns seem to work for some time now, eg: custom:
pythonRequirements:
noDeploy:
- setuptools
dockerizePip: non-linux
slim: true
slimPatterns:
- '**/*.egg-info*'
- 'botocore/data/!(*.json|events*|ssm*)' |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks for letting me know, it's been a while since I've looked at this. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks for the original post, it gave me some pointers back when I was looking at the same issue. In case anyone stumbles on this comment: today I've learned that the official AWS docs now say that you don't need to bundle any of the boto3 packages. plugins:
- serverless-python-requirements
custom:
pythonRequirements:
noDeploy:
- setuptools
- boto3
- botocore
- s3transfer
dockerizePip: non-linux
slim: true |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Stripping Down Botocore With Python Serverless Requirements :: Nathan Vaughn — Adventures in programming and tech
Background # The boto3 SDK and the underlying botocore package are very large Python libraries.
Just boto3 and botocore alone are over 50MB It can highly beneficial to reduce the size of these in a final build, especially in a serverless environment. AWS Lambda functions for instance only allow a maximum extracted size of 250MB, so this is over 1/5th of that alone. Additionally, a smaller package size also can dramatically improve the cold-start time of a function.
https://blog.nathanv.me/posts/stripping-botocore-python-serverless/
Beta Was this translation helpful? Give feedback.
All reactions