0

Does AWS NodeJS 14.x lambda runtime have python installed? I'm using a custom layer with AWS-CLI but it can't use python.

If I have to include python3 into the AWS-CLI Layer, how can I copy the python3 files needed? I think we need to compile python3 so it uses custom lib paths.

1 Answer 1

1

Try this;

Create your own docker image which has Python and NodeJs installed and well it's a linux image so you have flexibility to do anything, then push the image to ECR and create the lambda function from that image.

read this: https://docs.aws.amazon.com/lambda/latest/dg/images-create.html

Sign up to request clarification or add additional context in comments.

5 Comments

Does it cost us any extra than just running aws_lambda function?
the lambda doesn't cost any extra however I think you'll get charged when you push to ECR and that's almost nothing.
Is there a dockerfile example somewhere? I'm not sure what the CMD or anything needs to be passed for it to work properly. I can set entrypoint or CMD to node. Maybe just use an of example of nodejs image dockerfile ?
Seems like there is a example in the documentation. Testing it
Well as I said you have the full flexibility as if it's your own computer, you can either pull an alpine linux image and then install both nodejs and python on it or pull a nodejs runtime image and then install python in dockerfile or vice versa, depending on what you exactly want. you can put the CMD to CMD ["index.main"], with an index.js file and a main function in it. that main function will be executed each time you call the lambda, you also have python installed on the linux image, so inside your nodejs operation you run a python script as well or anything you want.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.