How rails-lambda/lamby works
Project type and purpose
• This is an open-source Ruby gem (“lamby”) that serves as an AWS Lambda Web Adapter for Rack-based applications (most commonly Rails).
• Its goal is to let you run a Rack (e.g., Rails) application on AWS Lambda behind Function URLs, API Gateway (HTTP/REST), or an Application Load Balancer.
File structure
• Top-level gem files: lamby.gemspec, Gemfile, Rakefile, LICENSE, README, .github workflows
• Bin scripts: bootstrap, console, setup, test, update – these drive development and testing tasks.
• lib/lamby/: core code – handler, Rack adapter layers (rack_http, rack_rest, rack_alb), proxy context/server, cold start metrics, debug, logger, config, and SSM parameter store integration.
• test/: unit tests and a dummy Rails app under test/dummy_app to simulate actual Rails behavior.
README for insights
• Describes support for multiple AWS invocation methods (Function URLs, API Gateway v1/v2, ALB).
• Points to “anatomy” docs that likely show internal flow: AWS event → Lamby handler → Rack → Rails.
Detailed callouts
• Cold start detection and metric emission in the handler.
• Bundle loading at cold start vs reuse on warm invocations.