{"id":15825120,"url":"https://github.com/discretetom/aws-lambda-runtime-api-inspector","last_synced_at":"2025-06-13T05:04:28.884Z","repository":{"id":235939491,"uuid":"791237754","full_name":"DiscreteTom/aws-lambda-runtime-api-inspector","owner":"DiscreteTom","description":"A lambda layer to print the runtime API requests and responses.","archived":false,"fork":false,"pushed_at":"2024-04-25T01:22:47.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-12T09:29:26.579Z","etag":null,"topics":["aws","aws-lambda","aws-lambda-runtime-api","aws-lambda-runtime-proxy"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DiscreteTom.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.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,"dei":null}},"created_at":"2024-04-24T10:53:19.000Z","updated_at":"2024-04-25T01:22:50.000Z","dependencies_parsed_at":"2024-04-25T02:38:30.716Z","dependency_job_id":"f9c0f256-c787-470d-b494-a1f7e51f00d2","html_url":"https://github.com/DiscreteTom/aws-lambda-runtime-api-inspector","commit_stats":null,"previous_names":["discretetom/aws-lambda-runtime-api-inspector"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/DiscreteTom/aws-lambda-runtime-api-inspector","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiscreteTom%2Faws-lambda-runtime-api-inspector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiscreteTom%2Faws-lambda-runtime-api-inspector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiscreteTom%2Faws-lambda-runtime-api-inspector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiscreteTom%2Faws-lambda-runtime-api-inspector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DiscreteTom","download_url":"https://codeload.github.com/DiscreteTom/aws-lambda-runtime-api-inspector/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiscreteTom%2Faws-lambda-runtime-api-inspector/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259584783,"owners_count":22880198,"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","aws-lambda","aws-lambda-runtime-api","aws-lambda-runtime-proxy"],"created_at":"2024-10-05T09:04:32.894Z","updated_at":"2025-06-13T05:04:28.847Z","avatar_url":"https://github.com/DiscreteTom.png","language":"Rust","readme":"# AWS Lambda Runtime API Inspector\n\n[![version](https://img.shields.io/github/v/tag/DiscreteTom/aws-lambda-runtime-api-inspector?label=release\u0026style=flat-square)](https://github.com/DiscreteTom/aws-lambda-runtime-api-inspector/releases/latest)\n![license](https://img.shields.io/github/license/DiscreteTom/aws-lambda-runtime-api-inspector?style=flat-square)\n![rust](https://img.shields.io/badge/built_with-rust-DEA584?style=flat-square)\n\nA lambda layer to print the runtime API requests and responses.\n\n## Usage\n\n### As a Lambda Layer\n\n1. Download the prebuilt zip from the [release page](https://github.com/DiscreteTom/aws-lambda-runtime-api-inspector/releases/latest). You can also build it yourself by running `cargo build --release`, then zip `scripts/entry.sh` with `target/release/aws-lambda-runtime-api-inspector`.\n2. Upload the zip as a lambda layer. Add the layer to your lambda function.\n3. Add an environment variable `AWS_LAMBDA_EXEC_WRAPPER` to the lambda function with the value `/opt/entry.sh` to enable the runner.\n4. Configure the [environment variables](#environment-variables) below to set the command you want to run.\n\n### As a Binary Executable\n\nIf you are using a custom lambda runtime (for rust, golang, c++, etc) or container image, you can run this as a parent process of your main handler process.\n\n1. Download the prebuilt zip from the [release page](https://github.com/DiscreteTom/aws-lambda-runtime-api-inspector/releases/latest) to get the `aws-lambda-runtime-api-inspector` executable. You can also build it yourself by running `cargo build --release`.\n2. Modify the entry command of the lambda function to `aws-lambda-runtime-api-inspector \u003chandler-command\u003e \u003chandler-args\u003e`\n3. Configure the [environment variables](#environment-variables) below to set the command you want to run.\n\n### Environment Variables\n\n- `AWS_LAMBDA_RUNTIME_API_INSPECTOR_TARGETS`\n  - Specify which requests and responses to print.\n  - Valid values:\n    - `NextInvocationRequest`\n    - `NextInvocationResponse`\n    - `NextInvocation`, equals to `NextInvocationRequest,NextInvocationResponse`\n    - `InvocationResponseRequest`\n    - `InvocationResponseResponse`\n    - `InvocationResponse`, equals to `InvocationResponseRequest,InvocationResponseResponse`\n    - `InitializationErrorRequest`\n    - `InitializationErrorResponse`\n    - `InitializationError`, equals to `InitializationErrorRequest,InitializationErrorResponse`\n    - `InvocationErrorRequest`\n    - `InvocationErrorResponse`\n    - `InvocationError`, equals to `InvocationErrorRequest,InvocationErrorResponse`\n    - Multiple values can be separated by `,`.\n  - If not set, all Lambda runtime API requests and responses will be printed.\n  - For more information about the runtime API, see [AWS Lambda Runtime API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-api.html).\n\n## Example Output\n\nHere is an example output of one cold start invocation, with all requests and responses printed:\n\n```\nRuntime API Request: GET /2018-06-01/runtime/invocation/next headers: {\"host\": \"127.0.0.1:3000\", \"accept\": \"*/*\", \"user-agent\": \"AWS_Lambda_Cpp/0.2.6\"} body: b\"\"\nRuntime API Response: [200 OK] headers: {\"content-type\": \"application/json\", \"lambda-runtime-aws-request-id\": \"04feef66-1b37-4f4f-85e5-c66ff4b5a9c0\", \"lambda-runtime-deadline-ms\": \"1713968525978\", \"lambda-runtime-invoked-function-arn\": \"arn:aws:lambda:us-east-1:123123123123:function:test\", \"lambda-runtime-trace-id\": \"Root=1-6629156f-0a9d5a7f74a36b1059e065fe;Parent=7c4d733f273bdab1;Sampled=0;Lineage=a3f0941e:0\", \"date\": \"Wed, 24 Apr 2024 14:21:35 GMT\", \"content-length\": \"49\"} body: b\"{\\\"key1\\\":\\\"value1\\\",\\\"key2\\\":\\\"value2\\\",\\\"key3\\\":\\\"value3\\\"}\"\nRuntime API Request: POST /2018-06-01/runtime/invocation/04feef66-1b37-4f4f-85e5-c66ff4b5a9c0/response headers: {\"host\": \"127.0.0.1:3000\", \"accept\": \"*/*\", \"content-type\": \"application/json\", \"user-agent\": \"AWS_Lambda_Cpp/0.2.6\", \"content-length\": \"33\"} body: b\"{\\\"statusCode\\\":200,\\\"body\\\":\\\"hello\\\"}\"\nRuntime API Response: [202 Accepted] headers: {\"content-type\": \"application/json\", \"date\": \"Wed, 24 Apr 2024 14:21:35 GMT\", \"content-length\": \"16\"} body: b\"{\\\"status\\\":\\\"OK\\\"}\\n\"\nRuntime API Request: GET /2018-06-01/runtime/invocation/next headers: {\"host\": \"127.0.0.1:3000\", \"accept\": \"*/*\", \"user-agent\": \"AWS_Lambda_Cpp/0.2.6\"} body: b\"\"\n```\n\n## FAQ\n\n- Q: How does this work?\n  - By using [AWS Lambda Runtime Proxy](https://github.com/DiscreteTom/aws-lambda-runtime-proxy) this tool can intercept the lambda handler process's runtime API requests.\n\n## [CHANGELOG](./CHANGELOG.md)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiscretetom%2Faws-lambda-runtime-api-inspector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiscretetom%2Faws-lambda-runtime-api-inspector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiscretetom%2Faws-lambda-runtime-api-inspector/lists"}