dvsa / dvsa-lambda-starter

A starting pattern for AWS lambda in Typescript
MIT License
5 stars 4 forks source link

Logger assumes that an APIGatewayProxyEvent is always available #27

Closed sam-artuso closed 4 years ago

sam-artuso commented 4 years ago

The factory function createLogger() assumes that an APIGatewayProxyEvent is always available. This doesn't hold true for lambdas triggered by other mechanisms e.g. CloudWatch scheduled events or DynamoDB triggers.

This coupling between the lambda handler and the logger factory is unnecessary and should be removed.