lambda-emulator
Skill0 starsChanged 10 days agoMITView on GitHub
How to try the function by hand with the Lambda runtime interface emulator in the AWS base image - docker compose, invoking with curl, choosing another function, sending an API Gateway HTTP API event, and reading errors. Use when you want to call the function as Lambda would, without deploying it.
- Sends data out
In this repository40 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- add-a-use-caseSkill
- api-conventionsSkill
- branches-and-pull-requestsSkill
- cancellationSkill
- ci-for-your-solutionSkill
- ci-pipelineSkill
- clean-architecture-layersSkill
- configuration-and-environmentsSkill
- coverageSkill
- csharp-house-styleSkill
- data-access-ef-coreSkill
- database-migrationsSkill
- docker-and-composeSkill
- docs-and-voiceSkill
- errors-and-exceptionsSkill
- expose-a-use-caseSkill
- family-syncSkill
- health-checksSkill
- integration-testsSkill
- json-serializationSkill
- mapping-with-mapperlySkill
- mediatorSkill
- optional-token-authSkill
- packages-and-dependenciesSkill
- pagingSkill
- presentation-integration-testsSkill
- releasesSkill
- sample-dataSkill
- security-findingsSkill
- serilogSkill
- telemetrySkill
- template-authoringSkill
- test-designSkill
- time-providerSkill
- unit-testsSkill
- validationSkill
- writing-a-skillSkill
- xml-docs-and-openapiSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 42
Read the container's output with docker compose logs function.
- Very specific: line 44
Stop it with docker compose down.
- Very specific: line 48
Use the emulator in place of tests.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Lambda runtime interface emulator
The rule
The runtime image is built on the AWS Lambda .NET base image, which includes the runtime interface emulator. Running the image locally gives an endpoint that invokes the function exactly as Lambda would. docker-compose.yml maps it to port 7350 and turns sample data on. The image runs GetMovies unless you name another handler. Each function's handler string names the class Lambda Annotations generates for it, and src/Presentation/serverless.template lists them all.
Steps
- Start it:
docker compose up -d --build. Invoke it by posting the request JSON to the emulator:
curl -X POST http://localhost:7350/2015-03-31/functions/function/invocations \ -d '{ "query": "global", "offset": 0, "limit": 5 }'To try another function, run the image with its handler string as the command:
docker build . --target run --tag cleanlambdafunction:local docker run --rm -p 7350:8080 -e Database__SeedSampleData=true cleanlambdafunction:local \ "Presentation::CleanLambdaFunction.Presentation.LambdaFunction.Handler_GetAuthors_Generated::GetAuthors"An HTTP API function (
HttpGetMovies,HttpGetAuthors,HttpGetReviews) takes the API Gateway HTTP API payload 2.0 event, not the request record. Run it by its handler string as in step 3 and post the event API Gateway would send. The query string values are strings, as they are on the wire:curl -X POST http://localhost:7350/2015-03-31/functions/function/invocations \ -d '{ "version": "2.0", "routeKey": "GET /movies", "rawPath": "/movies", "queryStringParameters": { "query": "global", "limit": "5" }, "requestContext": { "http": { "method": "GET", "path": "/movies" } } }'The answer has
statusCode,headersand the JSONbodyas a string. Header names come back in lower case.- Send a request that fails validation, such as
{ "limit": 0 }, and check the error'serrorTypeanderrorMessage. An HTTP API function answers a400withcontent-type: application/problem+jsoninstead, and"limit": "0"in the query string shows it. - Read the container's output with
docker compose logs function. The runtime's start, invoke and error lines sit between our compact JSON events, one per line, atDebugbecause compose setsSerilog__MinimumLevel__Default(serilog). Each invocation's trace, metrics and logs also land in the Aspire dashboard at http://localhost:7352, through the collector compose starts beside the function (telemetry). - Stop it with
docker compose down.
Don't
- Use the emulator in place of tests. Anything you check by hand gets a test (
presentation-integration-tests). - Expose port 7350 beyond your machine. The emulator has no authentication.
- Deploy to try a change. The emulator runs the same image Lambda would.
Check
docker compose up -d --build
curl -fsS -X POST http://localhost:7350/2015-03-31/functions/function/invocations -d '{}'
docker compose downDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

