aws / aws/aws-lambda-runtime-interface-emulator
Emulate API Gateway payload in event object
- Langage dominant
- Go
- Étoiles
- 1.1k
- Forks
- 118
- Merge moyen
- 42 min
- PR mergées (30 j)
- 2
Description
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.
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- go
- Domaine
- api, backend
- Type d'issue
- Fonctionnalité
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100