armature-lambda
AWS Lambda runtime adapter for the Armature framework.
Features
- Lambda Runtime - Run Armature apps on Lambda
- API Gateway - HTTP event handling
- ALB - Application Load Balancer support
- Cold Start Optimization - Minimal startup time
- Layers - Shared dependencies
Installation
[]
= "0.1"
Quick Start
The runtime wraps any type that implements RequestHandler. The simplest
handler is a closure taking a LambdaRequest and returning a LambdaResponse:
use ;
async
Configuration
Use LambdaConfig (via with_config) to control logging and strip an
API Gateway stage prefix such as /prod:
use ;
let config = default
.log_requests
.log_responses
.base_path;
// `app` is any type implementing `RequestHandler`.
let runtime = new.with_config;
runtime.run.await?;
API Gateway Integration
An Armature Application becomes a handler via the impl_request_handler!
macro, which forwards the full request (method, path, headers, query string,
path parameters, stage variables, and authorizer claims) to your app:
use *;
use ;
// #[module(controllers: [HelloController])]
// struct AppModule;
impl_request_handler!;
async
The runtime auto-detects API Gateway (REST v1 / HTTP v2), ALB, and Lambda Function URL events — no separate constructor is required.
Build for Lambda
# Install cargo-lambda
# Build
# Deploy
License
MIT OR Apache-2.0