aws / aws/aws-lambda-runtime-interface-emulator

Emulate API Gateway payload in event object

未关闭
#64 4 条评论 11 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Go
星标
1.1k
派生
118
平均合并
42 分钟
30 天内合并 PR
2

描述

We run our lambdas behind an API Gateway. The event object in the lambda when we run locally does not have the same structure as the event object when running behind an API Gateway.

For example, if I want to post to a path with the `/{model}` parameter, I need to post with this wrapping my payload
```
{
"pathParameters": {
"model": model
},
"body": { .. json payload ...}
}
```
When I call my API Gateway endpoint I do not need to wrap the payload, as this is created by API Gateway as it passes the payload off to the lambda.

What I would really like is to be able to set an ENV var such as `LAMBDA_MODE` which when set to `API_GATEWAY` RIE wraps the event to mimic the event passed by the API Gateway. It would need to work the same for response objects too. If not set, then it would work in the default mode which is how it works today.

贡献指南

打开贡献指南

调研方向

Start by tracing how the emulator currently receives and constructs the event object, then inspect the response path. Compare that behavior with the API Gateway structure described here and determine how the LAMBDA_MODE=API_GATEWAY setting should affect both request and response handling. Done means the default behavior remains unchanged and API Gateway-shaped events and responses are supported.

由索引模型根据 Issue 内容生成。

评估

技术栈
go
领域
api, backend
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。