Skip to content

isaacvando/roc-aws-lambda

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

roc-aws-lambda

A custom runtime for AWS Lambda written in Roc using basic-cli.

Usage

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.

Local Testing

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!

Contributing

PRs welcome!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published