Statically Linking Parts of a Shared Library?

I totally agree that rust on Lambda makes a lot of sense. Rust is so fast that we are getting charged way more than what we really use! :smiley: With AWS pricing, the CPU and memory are tightly coupled: You select how much memory you want/need, and the CPU power will be adapted accordingly. So less memory used and faster execution time means you can select the cheapest plan without trouble.

I did faced the same issue with Amazon Linux's OpenSSL version (1.0.2) not matching the one included in the Lambda environment (1.0.1). The problem comes when building the application in AMI (using OpenSSL 1.0.1) and running in on Lambda (using OpenSSL 1.0.2).

The "fix" I'm talking about is to not use AMI but use lambci/docker-lambda docker image instead. This Docker image is identical to the Lambda environment, including the same OpenSSL version (modulo some small changes). This way you can be sure to get the exact same version of libraries, so no discrepancy.

Mixing static and dynamic libs is not trivial. A static library is (almost) simply a concatenation of the built object files, while a dynamic lib has a different format (elf). Not sure of a way to easily mix those two...

1 Like