{"id":21231236,"url":"https://github.com/tanemahuta/aws-lambda-server","last_synced_at":"2025-09-07T16:34:57.393Z","repository":{"id":153307192,"uuid":"628714103","full_name":"Tanemahuta/aws-lambda-server","owner":"Tanemahuta","description":"HTTP Server invoking AWS Lambda Functions like the AWS API Gateway","archived":false,"fork":false,"pushed_at":"2025-09-05T13:08:10.000Z","size":1378,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-05T15:25:28.222Z","etag":null,"topics":["aws","aws-lambda","golang","http-server"],"latest_commit_sha":null,"homepage":"","language":"Go","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/Tanemahuta.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,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-04-16T19:43:00.000Z","updated_at":"2025-09-05T13:08:07.000Z","dependencies_parsed_at":"2023-12-11T14:35:26.483Z","dependency_job_id":"231a2a8e-fcf8-48f5-a545-d06c6a95c7a7","html_url":"https://github.com/Tanemahuta/aws-lambda-server","commit_stats":null,"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"purl":"pkg:github/Tanemahuta/aws-lambda-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tanemahuta%2Faws-lambda-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tanemahuta%2Faws-lambda-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tanemahuta%2Faws-lambda-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tanemahuta%2Faws-lambda-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tanemahuta","download_url":"https://codeload.github.com/Tanemahuta/aws-lambda-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tanemahuta%2Faws-lambda-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274064548,"owners_count":25216333,"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","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["aws","aws-lambda","golang","http-server"],"created_at":"2024-11-20T23:41:27.177Z","updated_at":"2025-09-07T16:34:57.354Z","avatar_url":"https://github.com/Tanemahuta.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"![build](https://github.com/Tanemahuta/aws-lambda-server/actions/workflows/verify.yml/badge.svg?branch=main)\n[![go report](https://goreportcard.com/badge/github.com/Tanemahuta/aws-lambda-server)](https://goreportcard.com/report/github.com/Tanemahuta/aws-lambda-server)\n[![codecov](https://codecov.io/gh/Tanemahuta/aws-lambda-server/branch/main/graph/badge.svg?token=FHO3AAZ41O)](https://codecov.io/gh/Tanemahuta/aws-lambda-server)\n[![Go Reference](https://pkg.go.dev/badge/github.com/Tanemahuta/aws-lambda-server.svg)](https://pkg.go.dev/github.com/Tanemahuta/aws-lambda-server)\n[![GHCR](https://ghcr-badge.egpl.dev/tanemahuta/aws-lambda-server/tags?trim=major,minor\u0026label=latest\u0026ignore=sha256*,v*)](https://github.com/Tanemahuta/aws-lambda-server/pkgs/container/aws-lambda-server/128648619)\n\n# aws-lambda-server\n\n## description\n\nA server which invokes AWS lambda functions from http requests, mapping the request to the payload.\n\n### docker image\n\nA docker image can be found at `ghcr.io/tanemahuta/aws-lambda-server:\u003ctag\u003e`.\n\n### routing\n\nRouting is achieved using [gorilla/mux](https://github.com/gorilla/mux).\n\nWhen using a path in the request route, you may use [path variables](https://github.com/gorilla/mux#readme)\n(e.g. `/test/{id}`), which will be parsed and propagated to the lambda invocation.\n\n### function invocation\n\nThe AWS lambda function is invoked using the [aws-sdk](https://aws.amazon.com/de/sdk-for-go/).\n\nIf you need to attach an IAM role in an EKS cluster, check out\n[this article](https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html).\n\n#### request\n\nThe parsed request is being adapted using [aws.LambdaRequest](pkg/aws/lambda_request.go).\n\nTo handle the request, you can use the first parameter in your handler:\n\n```javascript\nasync function handler(req, ctx) {\n    console.log(\"hostname\", req.host);\n    console.log(\"headers\", req.headers);\n    console.log(\"method\", req.method);\n    console.log(\"full uri\", req.uri);\n    console.log(\"parsed path variables\", req.vars);\n    console.log(\"read body\", req.body);\n}\n```\n\n#### response\n\nThe returned response is being adapted using [aws.LambdaResponse](pkg/aws/lambda_response.go).\n\nAn example response may look like this:\n\n```javascript\nasync function handler(req, ctx) {\n    return {\n        statusCode: 200,\n        headers: {\n            \"Content-Type\": \"text/plain\"\n        },\n        body: \"Hello world\"\n    }\n}\n```\n\nAlternatively the body may be a JSON, which will be serialized by the server:\n\n```javascript\nasync function handler(req, ctx) {\n    return {\n        statusCode: 200,\n        headers: {\n            \"Content-Type\": \"application/json\"\n        },\n        body: {\n            \"Hello\": \"World\"\n        }\n    }\n}\n```\n\nwhich will result in a `{\"Hello\":\"World\"}` in the server's HTTP response body.\n\n## command-line args\n\nWhen running the [binary](main.go), the following command line parameters can be used:\n\n- `--devel=(true|false)`: run in development mode (logging)\n- `--config-file=\u003cpath\u003e`: use the provided config file (default: `/etc/aws-lambda-server/config.yaml`)\n- `--listen=\u003caddr\u003e`: use the provided listen address (default: `:8080`) for serving the requests towards the lambda\n- `--metrics-listen=\u003caddr\u003e`: use the provided listen address (default: `:8081`) for serving metrics/health/readiness\n  checks\n\n## configuration\n\nThe configuration adds request matchers to a function. For the schema, start [here](pkg/config/server.go)\n\nAn annotated example config can be found [here](pkg/config/testdata/config.yaml).\n\n## metrics, healthz and readyz\n\nThe application provides health (`/healthz`) and readiness checks (`/readyz`) listening to the\nconfigured `--metrics-listen` address.\n\nAdditionally, the following [metrics are available](pkg/metrics/global.go):\n\n- `http_requests_total`: counter for total http requests served\n- `http_request_duration_seconds`: histogram for http request duration\n- `http_request_size_bytes`: histogram for http request size\n- `http_response_size_bytes`: histogram for http response size\n- `aws_lambda_invocation_total`: counter for AWS lambda invocations by function ARN\n- `aws_lambda_invocation_errors_total`: gauge for AWS lambda invocation errors by function ARN\n- `aws_lambda_invocation_duration_seconds`: histogram AWS lambda invocation duration by function ARN\n\n## helm-chart\n\nHelm charts are created from the [charts directory](charts) and published to [this repository](https://tanemahuta.github.io/aws-lambda-server).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftanemahuta%2Faws-lambda-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftanemahuta%2Faws-lambda-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftanemahuta%2Faws-lambda-server/lists"}