Run ruby code on JRuby on AWS Lambda Java
based on: https://github.com/plainprogrammer/aws-lambda-jruby
Rake task downloads jruby-complete, install all gems from Gemfile inside a jar and create final jar ready to be deployed.
- Add your ruby code to
lib/hello.rb
please note that you cannot use Bundler.require
,
you have to require all gems manually like require 'rspec'
- Build project
rake
- Deploy using serverless
sls deploy
- Run Lambda function
sls invoke -f hello -d JohnDoe
needs timeout of at least 60 sec for the first execution of the lambda