Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/isaacvando/roc-aws-lambda
https://github.com/isaacvando/roc-aws-lambda
aws aws-lambda lambda roc-lang rust
Last synced: 25 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/isaacvando/roc-aws-lambda
- Owner: isaacvando
- License: upl-1.0
- Created: 2024-03-13T23:55:28.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-01-04T23:17:35.000Z (about 1 month ago)
- Last Synced: 2025-01-19T22:47:19.769Z (26 days ago)
- Language: Roc
- Size: 18.4 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- roc-awesome - isaacvando/roc-aws-lambda - aws-lambda-runtime](https://github.com/isaacvando/roc-aws-lambda-runtime) for a pure Roc implementation.) (Roc Platforms 🏢)
README
# roc-aws-lambda
A [custom runtime](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.html) for AWS Lambda written in Roc using [basic-cli](https://github.com/roc-lang/basic-cli).
## Usage
To write a Lambda, update `Handler.roc`:
```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:
```bash
$ ./build.sh
```Then deploy the Lambda to AWS with the deployment script:
```bash
$ ./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:
```bash
echo some input | roc local.roc
Hello, World!
```## Contributing
PRs welcome!