I had some AWS Lambda functions running on Python 3.7 runtime, and my target was to update them to Python 3.11.
They have some functionality (JDBC connections) which requires running JVM on the runtime environment.
Once I’ve made all the changes, I’ve realized that this functionality is broken (the error message I had was “libjvm.so is not found”
When I checked further, I realized that AWS Lambda Python3.11 environment doesn’t have java pre-installed, as Python3.7 environment had (I’ve compared several different images from https://gallery.ecr.aws/lambda/python to double check this)
So I ended up with creating an additional AWS Lambda Layer, by running something like:
docker run --rm -v "$PWD"/java:/lambda/opt lambci/yumda:2 yum install -y java-1.8.0-openjdk-headless.x86_64
then zipping the contents of the created image, and using them for the layer creation.
This worked, and all my lambdas works as expected now, but I’m wondering whether this way is overcomplicated, and there could be an easier one?
Thanks for all advices.