A custom runtime for AWS Lambda written in Roc using basic-cli.
To write a Lambda, update Handler.roc
:
handle! : List U8 => Result Str _
handle! = \bytes ->
# Your logic here
The runtime code is in bootstrap.roc
which is compiled to a binary called bootstrap
that Lambda runs to initialize the runtime. Once the runtime receives a request from Lambda, it calls Handler.handle
to process the request.
To build a function, use the included script:
$ ./build.sh
Then deploy the Lambda to AWS with the deployment script:
$ ./deploy.sh your_function_name arn:aws:iam::{your_account_id}:role/{your_role_name}
or by manually uploading the bootstrap.zip
generated by build.sh
to the AWS Console.
You can test your functions locally with local.roc
. It will read input from stdin and pass it to the function:
echo some input | roc local.roc
Hello, World!
PRs welcome!