aws / aws/aws-lambda-runtime-interface-emulator
Emulate API Gateway payload in event object
- 主要語言
- 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.
貢獻指南
研究方向
首先追蹤 emulator 目前如何接收並建構 event object,接著檢查 response 路徑。將該行為與此處描述的 API Gateway 結構進行比較,並判斷 LAMBDA_MODE=API_GATEWAY 設定應如何影響 request 和 response 的處理。完成的標準是預設行為維持不變,並支援 API Gateway 格式的 event 和 response。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- go
- 領域
- api, backend
- Issue 類型
- 功能
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100