And converts almost any office document to PDF:

But stripped from useless stuff, so it takes only 109 out of 250 MB function's zip artifact.

This is a full featured LibreOffice compiled to run in AWS Lambda environment.

This will result in 5 terabytes of S3 storage per month. As you see, this is the primary driver of price, not computing cost.

So you need to convert 1 million documents average of 5 MB size.

Open Improvements

Reduce Cold Start Time

Currently ƛ unpacks 109 MB .tar.gz to /tmp folder which takes ~1-2 seconds on cold start.

Would be nice to create a single compressed executable to save unpack time and increase portability. I tried using Ermine packager and it works!! But unfortunately this is commercial software. Similar open-source analogue Statifier produces broken binaries.

Maybe someone has another idea how to create a single executable from a folder full of shared objects.

Further Size Reduction

I am not a Linux or C++ expert, so for sure I missed some easy "hacks" to reduce size of compiled LibreOffice.

Mostly I just excluded from compilation as much unrelated stuff as possible. And stripped symbols from shared objects.

Here is the list of: available RPM packages and libraries available in AWS Lambda Environment, which can be helpful.