CodeGenieApp / CodeGenieApp/serverless-express
Support for Cloudfront as event source
- Lingua principale
- JavaScript
- Stelle
- 5.3k
- Fork
- 676
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
I've got requests passing through a Cloudfront distribution directly to a lambda, no cache, passing all request headers with it. I'm using this approach because API Gateway and ALB are both overkill for my use-case, simply need a public endpoint with custom domain compatibility, hence Cloudfront.
Issue is that this library produces a `Unable to determine event source based on event` error in this setup. Having a look at the code it seems [here](https://github.com/vendia/serverless-express/blob/75cfbffeb3fd030695b9587a75300c7b8012ac6a/src/event-sources/utils.js#L70) that there is no conditional to detect this circumstance.
Since I'm passing all headers directly through Cloudfront, I assume that the event in this case looks a lot like it came directly from the client, rather than something triggered through another cloud service. This seems to me perhaps as a valid default case to design for in this library, in the absence of any other forwarders?
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia da src/event-sources/utils.js intorno alla riga 70, dove il rilevamento dell’origine dell’evento attualmente non funziona per la richiesta CloudFront-to-Lambda descritta. Riproduci o ispeziona un evento in cui CloudFront inoltra tutti gli headers, quindi definisci il comportamento di rilevamento necessario per questo caso di endpoint diretto. Il lavoro è completato quando l’evento viene accettato senza l’errore "Unable to determine event source" e il comportamento pertinente è coperto da test, se il repository li fornisce.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- aws, express, javascript, node.js
- Ambito
- api, backend, cloud
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100