1

I have written a python code on local ubuntu environment but now i need to deploy it into AWS Lambda. In my code i am using java using shell command.

proc = subprocess.Popen(["java -jar jarfile.jar input_file output_file], stdout=subprocess.PIPE, stderr=subprocess.PIPE,shell=True)

Java is installed on ubuntu using

sudo apt install default-jre
sudo apt install default-jdk

Unlike python packages, java is installed globally. How will i build python deployment package that contains Java Library so that it can be used using Shell Command ?

1 Answer 1

1

You should probably convert the Java code into another Lambda function, or just write a Java Lambda function that does nothing but call that Java code inside the jar file.

Deploy that as a separate Lambda function and invoke it from the Python Lambda function.

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

2 Comments

Would there be a considerable delay with this method? Or if I create them in same region, then only minimal delay?

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.