{"id":22237680,"url":"https://github.com/vagmi/rust-lambda","last_synced_at":"2026-04-13T14:32:09.486Z","repository":{"id":176674374,"uuid":"658761660","full_name":"vagmi/rust-lambda","owner":"vagmi","description":"A template for Rust Lambda functions","archived":false,"fork":false,"pushed_at":"2024-02-01T01:10:27.000Z","size":362,"stargazers_count":3,"open_issues_count":5,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-22T10:44:08.570Z","etag":null,"topics":["aurora-serverless","aws","axum","cdktf","gh-actions","lambda","postgres","rust","sqlx","terraform"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vagmi.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"dei":null}},"created_at":"2023-06-26T12:45:43.000Z","updated_at":"2024-02-01T03:15:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"3fa01f71-e407-4ae0-931d-5cb2bcca6cc3","html_url":"https://github.com/vagmi/rust-lambda","commit_stats":null,"previous_names":["vagmi/rust-lambda"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vagmi/rust-lambda","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vagmi%2Frust-lambda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vagmi%2Frust-lambda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vagmi%2Frust-lambda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vagmi%2Frust-lambda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vagmi","download_url":"https://codeload.github.com/vagmi/rust-lambda/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vagmi%2Frust-lambda/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31757477,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T13:27:56.013Z","status":"ssl_error","status_checked_at":"2026-04-13T13:21:23.512Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["aurora-serverless","aws","axum","cdktf","gh-actions","lambda","postgres","rust","sqlx","terraform"],"created_at":"2024-12-03T03:12:09.687Z","updated_at":"2026-04-13T14:32:09.462Z","avatar_url":"https://github.com/vagmi.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Write a lambda function in Rust\n\nThis is an example to setup a Rust based Axum Service as a lambda function. When\ncompiled in debug mode, it can be run locally with just a HTTP client. But when \ncompiled in Release mode, it uses the lambda handler.\n\nIt uses Aurora PostgreSQL serverless V1 so that it scales down to zero. I wrote \nthis to support one off services that we use internally at \n[Tarka Labs](https://tarkalabs.com) such as Slack bots. \n\n## Infrastructure\n\nThe entire infrastructure is setup with [CDKTF](https://developer.hashicorp.com/terraform/cdktf)\nand is run with Github actions. You need to set up `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` and \n`AWS_REGION` variables in your repository secrets section for github actions.\n\nWe use a S3 Backend with a dynamo db table for our our state tracking with terraform projects. I have a sample\nin `infra/backend.ts`. To set it up, you can run just the backend with the following commands\nlocally or on a devops machine.\n\n```\n$ cd infra\n$ yarn global add cdktf-cli\n$ yarn\n$ cdktf get\n$ cdktf deploy remote-backend\n```\n\n## About the lambda\n\nIt uses Axum for routing and SQLX for database handling. It embeds the migrations\nand autoruns them when the app starts. It can be run locally in the debug mode, but\nwhen built in release mode, it can only be run on lambda. It supports structured logging\nin JSON using the tracing crate.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvagmi%2Frust-lambda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvagmi%2Frust-lambda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvagmi%2Frust-lambda/lists"}