ashiina/lambda-local

Possibility to override context properties like functionName

Closed this issue · 1 comments

Hello!
First of all, thanks for lambda-local, this is an excelent product.

I have some use cases where I read infomation (like functionName) from the context object and I use it as part of my pk/sk in DynamoDB. In other cases I post messages to EventBridge and the function name is used as the Source field.

I digged through the code and saw that currently there's no way to override the context object properties.
In the case of functionName, it uses the name of the handler function or defaults to the string handler.

This messes up some of my use cases because every developer running lambda-local will end up with the same functionName on the context object. For instance, it causes DynamoDB records to be overwritten and all EventBridge events have the same Source.

I'd like to request a feature where we could overwrite some of the context properties, or even supply our own object.

Thanks!

fixed by #240