{"id":18340399,"url":"https://github.com/dimensiondev/aws_lambda_rust_template","last_synced_at":"2025-04-09T20:43:38.384Z","repository":{"id":98073238,"uuid":"459430363","full_name":"DimensionDev/aws_lambda_rust_template","owner":"DimensionDev","description":"Boilerplate for using Rust on Amazon AWS Lambda","archived":false,"fork":false,"pushed_at":"2022-04-23T07:30:04.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-02-15T12:52:45.549Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DimensionDev.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":null,"funding":null,"license":null,"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,"publiccode":null,"codemeta":null}},"created_at":"2022-02-15T04:44:48.000Z","updated_at":"2022-02-15T04:45:51.000Z","dependencies_parsed_at":"2023-05-23T10:15:37.607Z","dependency_job_id":null,"html_url":"https://github.com/DimensionDev/aws_lambda_rust_template","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DimensionDev%2Faws_lambda_rust_template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DimensionDev%2Faws_lambda_rust_template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DimensionDev%2Faws_lambda_rust_template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DimensionDev%2Faws_lambda_rust_template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DimensionDev","download_url":"https://codeload.github.com/DimensionDev/aws_lambda_rust_template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248110585,"owners_count":21049513,"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":[],"created_at":"2024-11-05T20:22:24.657Z","updated_at":"2025-04-09T20:43:38.358Z","avatar_url":"https://github.com/DimensionDev.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"* AWS Lambda template for Rust\n:PROPERTIES:\n:ID:       1006a34f-ab4b-4083-8146-b8e5d32296a7\n:END:\n\n** How to use\n:PROPERTIES:\n:ID:       643cbc6e-29d0-49c6-a371-73cf4fa3408b\n:END:\n\n*** Preparation\n:PROPERTIES:\n:ID:       8aafaeea-a060-4c32-b019-57585d422880\n:END:\n\nSee [[https://github.com/cross-rs/cross][cross-rs/cross]] for installation guide.\n\n#+begin_quote\nIn brief:\n\n1. =docker= should be prepared.\n2. =cargo install cross=\n#+end_quote\n\n*** Compile\n:PROPERTIES:\n:ID:       a6c39eba-7d1c-4f20-ac30-1cc9200c8631\n:END:\n\n#+begin_src sh\n  make lambda-build\n#+end_src\n\n*** Create lambda function\n:PROPERTIES:\n:ID:       0fbf06c4-5583-44ac-ba1e-64cd63c91a65\n:END:\n\nCreate a file named `lambda.mk` with these content:\n\n#+begin_src makefile\n  # Modify with your choice.\n  function-name=my_function_name\n  # Create a role for this function runtime on AWS beforehead.\n  function-role=arn:aws:iam::xxxx\n#+end_src\n\nThen,\n\n#+begin_src sh\n  make lambda-create\n#+end_src\n\n*** Upload / Update function\n:PROPERTIES:\n:ID:       d424191c-2477-4487-9943-6a7f9a78c790\n:END:\n\n#+begin_src sh\n  make lambda-update\n#+end_src\n\n*** Create API Gateway\n:PROPERTIES:\n:ID:       977a7ffc-1d0f-4712-bcbd-4c273b7383d7\n:END:\n\nRefer to [[https://github.com/akrylysov/algnhsa][akrylysov/algnhsa]] -\u003e =Setting up API Gateway= chapter.\n\nIf needed, create a =Stage= for this API.\n\n** [0/1] TODOs\n:PROPERTIES:\n:ID:       a8f496f0-5c75-478d-8dfe-8eb8a544a30a\n:END:\n\n*** TODO Intergrate a \"true\" HTTP server w/ full router support\n:PROPERTIES:\n:ID:       c8d3330d-da52-487b-b670-e1b987df0662\n:END:\n\nSince =master= branch of =lambda_http::Request= implements\n=tower::Service= trait, we should use something like this to\ndramatically decrease complexity of current code.\n\n#+begin_src rust\n  // Copied from https://github.com/awslabs/aws-lambda-rust-runtime/issues/404\n  use tower::Service;\n  use lambda_http::{Request, ServiceExt};\n\n  #[derive(Default)]\n  struct MyHandler;\n\n  //   vvvvvvvvvvvvvvvv HERE\n  impl Service\u003cRequest\u003e for MyHandler {\n      // skipped\n  }\n\n  #[tokio::main]\n  async fn main() -\u003e Result\u003c(), Error\u003e {\n      // Use lambda_http::run to wrap the Service\n      lambda_http::run(MyHandler::default()).await\n  }\n#+end_src\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimensiondev%2Faws_lambda_rust_template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdimensiondev%2Faws_lambda_rust_template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimensiondev%2Faws_lambda_rust_template/lists"}