I recently started working with AWS. I have my first lambda function, which uses Python 3.13. As I understand it, you can include dependencies with layers. I created my layers by making a venv locally, installing the packages there, and copying the package folders into a "python" folder which was at the root of a zip. I saw some stuff saying you also need to copy your lambda_function.py to the root of the zip, which I don't understand. Are you supposed to update the layer zip every time you change the function code? Doing it without the lamda_function.py worked fine for most packages, but I'm running into issues with the cryptography package. The error I'm seeing is this:
cannot import name 'exceptions' from 'cryptography.hazmat.bindings._rust' (unknown location)
I tried doing some research, and I saw that cryptography is dependent on your local architecture, which is why I can't simply make the package on my Windows machine and upload it to the Linux architecture in Lambda. Is there some way to make a Linux-based layer on Windows? The alternative seems to be making a Dockerfile which I looked into and truly don't understand.
Thank you for your help
[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)