Skip to content

Support dependency injection in lambda parameters #924

Description

@RobinVds

Is your feature request related to a problem? Please describe.
I'm injecting my dependencies in my lambda functions to be able to easily test my functions.

@logger.inject_lambda_context(log_event=True)
def lambda_handler(event,
                   context,
                   s3_client=s3,
                   sqs_queue=sqs_queue):

Describe the solution you'd like
Would it be possible to just allow more parameters in the decorator function than only event and context? Just pass all the parameters that are included in the lambda function call.

Describe alternatives you've considered
Not relying on dependency injection and testing one level lower.

Additional context
Not sure if this way of testing lambdas is a best practice but it makes it a lot easier that's for sure.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions