简体   繁体   中英

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?

  • Event type: All object create events
  • Runtime: Node.js 14.x

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 isthis article that indicates there is a lambda layer that may give you R access - you should check that out

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM