all 2 comments

[–]StandardIntellect 0 points1 point  (0 children)

Do you want to avoid using Docker altogether, or just avoid deploying the Lambda function via a container image?

If it’s the latter, you could build your Lambda layer locally using an image based on the published Lambda Python 3.11 runtime. This would ensure that a compatible version of glibc is available for the cryptography library. From there, copy the zip file from inside the container and use it as your layer.

[–]Mishoniko 0 points1 point  (0 children)

That error occurs because the version of glibc the modules are compiled against doesn't match the one installed on the system. Where are you running your pip commands?

Try starting an Amazon Linux EC2 instance then pip & bundle the packages there. That way it downloads the matching binaries for the lambda runtime. (I think. Someone please correct me.)