Skip to content

Automation scripts to help run Ruby 2.1 programs on AWS Lambda

License

Notifications You must be signed in to change notification settings

lorennorman/ruby-on-lambda

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ruby on AWS Lambda

Why?

Because:

  • AWS Lambda has immense potential and interesting implications
  • AWS Lambda doesn't officially support Ruby, as yet
  • Ruby has immense potential and interesting implications as well!

How?

By:

  • packaging a Ruby binary with our app
  • Lambda executes a simple NodeJS program that shells out to our code
    • see index.js
  • Ruby executes your code
    • yes, Bundler works! (within reason)
  • Hello World is about 8MB, leaving you 42MB of room to get crazy
    • (no native gems)

Usage

  1. Sign up for Amazon AWS
  2. Get access to Amazon S3
  3. Get access to Amazon Lambda
  4. Create an IAM account with access to S3 and Lambda
  5. Install the aws cli tools
  6. Set up an AWS profile in ~/.aws/credentials for the account created above
  7. Change the variables in deploy.sh to match your app and AWS settings
  8. Ensure you're using ruby 2.1.x in this directory
  9. Ensure you're using Bundler version 1.9.9
  10. Add any gems you need to app/Gemfile
  11. cd app and run bundle install from there (you need a Gemfile.lock)
  12. edit app/app.rb with your application code
  13. run ./deploy.sh linux-x86_64
  14. test your Lambda Function!
  • i've been using the web console for testing

About

Automation scripts to help run Ruby 2.1 programs on AWS Lambda

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published