Skip to content

A Docker image that you build and run to package your Ruby code so it can run on a node.js Lambda fiction on AWS.

License

Notifications You must be signed in to change notification settings

calasyr/lambda_ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Finally!

Ruby is now supported on Lambda, so there's no longer any need for this repo. Yeah!

https://aws.amazon.com/blogs/compute/announcing-ruby-support-for-aws-lambda/

lambda_ruby

Get your Ruby running on Lambda.

On 2016/12/09 the AWS Compute Blog described a technique for running unsupported languages on AWS Lambda.

https://aws.amazon.com/blogs/compute/scripting-languages-for-aws-lambda-running-php-ruby-and-go/

I gave it a try for Ruby and it worked for me. So I created a Docker image that automates most of the work.

Put your Ruby into your_ruby.rb, build the image and then run a new container to get the zip file for Lambda.

To build the supplied Docker image from the root directory of this repo.
$ docker build .

Then run this command, replacing <DOCKER_IMAGE> with the id of the image you just built. $ docker run -tiP -v ${PWD}:/result <DOCKER_IMAGE> cp /lambda_ruby/ruby.zip /result

This should copy ruby.zip to this same directory.

You can now upload this 7 megabyte file to a node.js AWS Lambda. This Lambda function will need a handler called 'ruby.handler'.

And you will need an execution role that can write to CloudWatch logs. A role with the AWSLambdaBasicExecutionRole managed policy, for example.

About

A Docker image that you build and run to package your Ruby code so it can run on a node.js Lambda fiction on AWS.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •