{"id":13476601,"url":"https://github.com/anmonteiro/aws-lambda-ocaml-runtime","last_synced_at":"2025-05-08T21:45:53.726Z","repository":{"id":33658715,"uuid":"159987032","full_name":"anmonteiro/aws-lambda-ocaml-runtime","owner":"anmonteiro","description":"An OCaml custom runtime for AWS Lambda and Vercel","archived":false,"fork":false,"pushed_at":"2023-03-26T21:06:45.000Z","size":2677,"stargazers_count":207,"open_issues_count":6,"forks_count":8,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-05-22T21:31:14.193Z","etag":null,"topics":["aws-lambda","ocaml","serverless"],"latest_commit_sha":null,"homepage":"","language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anmonteiro.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-12-01T21:03:23.000Z","updated_at":"2024-05-20T12:42:42.000Z","dependencies_parsed_at":"2024-01-06T02:03:23.785Z","dependency_job_id":"a8ca654c-0c41-45d8-a926-ab95469defc2","html_url":"https://github.com/anmonteiro/aws-lambda-ocaml-runtime","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anmonteiro%2Faws-lambda-ocaml-runtime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anmonteiro%2Faws-lambda-ocaml-runtime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anmonteiro%2Faws-lambda-ocaml-runtime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anmonteiro%2Faws-lambda-ocaml-runtime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anmonteiro","download_url":"https://codeload.github.com/anmonteiro/aws-lambda-ocaml-runtime/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237911793,"owners_count":19386140,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws-lambda","ocaml","serverless"],"created_at":"2024-07-31T16:01:32.439Z","updated_at":"2025-02-10T02:12:24.865Z","avatar_url":"https://github.com/anmonteiro.png","language":"OCaml","funding_links":[],"categories":["OCaml"],"sub_categories":[],"readme":"# OCaml Runtime for AWS Lambda\n\nThis package provides a [custom\nruntime](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.html) for\nAWS Lambda.\n\n## Installation\n\nThis repository provides two libraries:\n\n- `lambda-runtime` provides a runtime and API for\n  [AWS Lambda](https://aws.amazon.com/lambda/) and\n  [API Gateway](https://aws.amazon.com/api-gateway/).\n- the `vercel` library depends on `lambda-runtime` and provides an interface to\n  the [Vercel](https://vercel.com/) service that resembles a request / response\n  exchange.\n\n\nThe libraries in this repo are released to the OPAM package registry.\n\nYou can depend on them via:\n\n1. [__esy__](esy): `esy add @opam/lambda-runtime` and / or `esy add @opam/vercel`\n2. [__OPAM__](opam): `opam install lambda-runtime vercel`.\n\n[esy]: https://esy.sh\n[opam]: https://opam.ocaml.org\n\n## Example function\n\nSee the [`examples`](./examples) folder.\n\n## Deploying\n\n**Note**: Based on the instructions in this [blog\npost](https://aws.amazon.com/blogs/opensource/rust-runtime-for-aws-lambda/) and\nthe Rust custom runtime\n[repository](https://github.com/awslabs/aws-lambda-rust-runtime)\n\nFor a custom runtime, AWS Lambda looks for an executable called `bootstrap` in\nthe deployment package zip. Rename the generated `basic` executable to\n`bootstrap` and add it to a zip archive.\n\nThe Dockerfile (in conjunction with the [`build.sh`](./build.sh) script) in this\nrepo does just that. It builds a static binary called `bootstrap` and drops it\nin the target directory.\n\n```shell\n$ ./build.sh \u0026\u0026 zip -j ocaml.zip bootstrap\n```\n\nNow that we have a deployment package (`ocaml.zip`), we can use the [AWS\nCLI](https://aws.amazon.com/cli/) to create a new Lambda function. Make sure to\nreplace the execution role with an existing role in your account!\n\n```shell\n$ aws lambda create-function --function-name OCamlTest \\\n  --handler doesnt.matter \\\n  --zip-file file://./ocaml.zip \\\n  --runtime provided \\\n  --role arn:aws:iam::XXXXXXXXXXXXX:role/your_lambda_execution_role \\\n  --tracing-config Mode=Active\n```\n\nYou can now test the function using the AWS CLI or the AWS Lambda console\n\n```shell\n$ aws lambda invoke --function-name OCamlTest \\\n  --payload '{\"firstName\": \"world\"}' \\\n  output.json\n$ cat output.json  # Prints: {\"message\":\"Hello, world!\"}\n```\n\n## Copyright \u0026 License\n\nCopyright © 2018 António Nuno Monteiro\n\nDistributed under the 3-clause BSD License (see [LICENSE](./LICENSE)).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanmonteiro%2Faws-lambda-ocaml-runtime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanmonteiro%2Faws-lambda-ocaml-runtime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanmonteiro%2Faws-lambda-ocaml-runtime/lists"}