Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibility to override context properties like functionName #225

Closed
danielsitnik opened this issue Sep 15, 2022 · 1 comment
Closed

Possibility to override context properties like functionName #225

danielsitnik opened this issue Sep 15, 2022 · 1 comment

Comments

@danielsitnik
Copy link

danielsitnik commented Sep 15, 2022

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!

@gpotter2
Copy link
Collaborator

fixed by #240

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants