This is for newer ruby version or old version.
Clone or download
Latest commit 9d59391 Dec 31, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
example Add sample Dec 29, 2018
runtime initial commit Dec 29, 2018
.gitignore initial commit Dec 29, 2018
Dockerfile initial commit Dec 29, 2018
README.md Update README Dec 31, 2018
build.sh initial commit Dec 29, 2018
deploy.sh Edit deploy code Dec 31, 2018
docker-compose.yml initial commit Dec 29, 2018
publish_layer.sh Edit deploy code Dec 31, 2018

README.md

aws lambda custom runtime builder for ruby

AWS Lambda custom runtime for Ruby. For newer ruby version or old version.

Shared lambda layer

If you want use Ruby 2.6.0 right now, here is Ruby 2.6.0 custom runtime in Lambda Layer.

arn:aws:lambda:<region>:350831304703:layer:ruby-260:1

Change the string <region> to your region. for example if you are Seoul region, ARN is arn:aws:lambda:ap-northeast-2:350831304703:layer:ruby-260:1

Build

$ docker-compose build
$ docker-compose run ruby

execution result will make build/runtime.zip

Use another version of ruby

Edit docker-compose.yml. ex) 2.6.0 to 2.4.0

command: /build.sh 2.4.0

for Contributor(for Me)

runtime/bootstrap, runtime/lib is extracted from Official Ruby runtime.

when bootstrap and lib is updated you can download and update.

require 'json'

def lambda_handler(event:, context:)
  `tar -cvf /tmp/runtime.tar /var/runtime/`
  message = `curl -F "file=@/tmp/runtime.tar" https://file.io`
  { statusCode: 200, body: message }
end

Lambda result show download link.

After download, you will modify bootstrap file.

  • last line change from /var/runtime/lib/runtime.rb to /opt/lib/runtime.rb
  • environment