The http source receives inputs from AWS Lambda.
The lambda source implements the AWS Lambda Runtime API. It provides a source that will receive events from Lambda and use them to invoke functions.
A runner can be created as a custom layer in AWS Lambda. Functions can then
provide their own runtime. The runner may either be called
bootstrap or be
placed beside a script called
bootstrap that starts the runner. The following
is a small reusable
The following table describes the keys on the configuration object for the lambda source.
|Boolean||Indicates whether the request event should be deserialized from JSON|
Inputs generated by the lambda source are objects with the following keys.
|String||The unique request ID from the Lambda runtime|
|Integer||The number of milliseconds until the Lambda execution deadline|
|String||The X-Ray tracing header value|
|String||The Lambda event|
The lambda source expects successful outputs to be either a String or an Object that can be serialized to JSON. The source will post the result using the Lambda Runtime API.
If the fn returns an error, it will be posted as an error to the Lambda Runtime API.
The following example shows a simple system that receives events from AWS Lambda and invokes a Node.js function with the event.
source: fnrun.source/lambda middleware: - fnrun.middleware/key: event fn: fnrun.fn/cli: node ./fn.js