Resolving unzipped size must be smaller


I am trying to solve the infamous Lambda limitation of 250MB and cannot wrap my head around why the error exists or how to solve it.

I have a python 3.8 runtime running Framework 2.69.0. Each function I’m trying to deploy zipped up is indicated as 34.78MB. I am adding two layers: datadog-plugin and a custom layer I have created for libraries at 28MB.

Is AWS actually telling me that DD-plugin is 200MB? (that would be hard to believe that it is THAT fat)

I have "excluded’ docs/node_modules/Jenkinsfile/Dockerfiles…etc as i tries to ship the “root” when I know there are just bookkeeping.

I know I can take control and ship a container instead but I would like to optimize my possibilities with serverless first. I’m familiar that with webpack for nodejs I can shrink it down more, however what is the solution for pythons? I have already removed Boto as the runtime provides boto - I am running out of ideas now and would like some guidance on best practice to bundle a function for python as I thought 34MB was small but uncompress it is still asking me to manipulate the package.