King_Cordelia
King_Cordelia

Reputation: 223

AWS lambda function -how to get R script to run from node.js lambda function?

I have an already existing AWS lambda function whose trigger event is any updates to a particular S3 bucket. I need to run this S3 input through some R scripts. The runtime is node.js and other events depend on this being a node.js configuration. The scripts I need to run must be in R because other languages aren't suitable.

How to I get the R scripts to run from this node.js lambda function?

Upvotes: 0

Views: 624

Answers (1)

lynkfox
lynkfox

Reputation: 2400

If you want to try and run two languages in the same lambda your only choice is to deploy a custom Docker image for the lambda container with both the languages installed.

However. Its not like there is a command line for you to access, so unless you code your nodejs lambda to call the R script and wait for its response(which is technically possible) you wont be able to just call it.

You are probably better off deploying a second lambda with a custom docker that just has R on it (as R is not a language lambda supports yet) and call that lambda using the SDK and wait for its response.

Though, there is this article that indicates there is a lambda layer that may give you R access - you should check that out

Upvotes: 1

Related Questions