(aws-lambda-python): bundling lambda code with platform-specific dependencies #19700
Unanswered
ivan-luska
asked this question in
Q&A
Replies: 1 comment
-
Any feedback on this? Thanks. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
General Issue
Unable to correctly bundle lambda for ARM_64 architecture
The Question
Hello,
I tried to deploy & run lambda code with some platform-specific dependencies (having some C bindings, e.g. pyOpenSSL - https://pypi.org/project/pyOpenSSL/). It works fine for x86_64 architecture, but on ARM_64 the lambda is unable to run, because wrong dependencies were installed (those for x86_64 architecture). In the CDK code it looks like it selects the Docker container for bundling only based on runtime, not target architecture. The question is - Is this a bug or desired behaviour?
The documentation says:
If requirements.txt, Pipfile or poetry.lock exists at the entry path, the construct will handle installing all required modules in a Lambda compatible Docker container according to the runtime and with the Docker platform based on the target architecture of the Lambda function.
CDK CLI Version
2.9.0 (build a69725c)
Framework Version
CDK 1.147.0
Node.js Version
No response
OS
MacOS Big Sur
Language
Python
Language Version
Python 3.8.12
Other information
requirements.txt content:
pyopenssl
related lambda config in CDK:
runtime=Runtime.PYTHON_3_8, architecture=Architecture.ARM_64,
Beta Was this translation helpful? Give feedback.
All reactions