python-lambda-local icon indicating copy to clipboard operation
python-lambda-local copied to clipboard

Instance method as function name in command line

Open ksmoore17 opened this issue 4 years ago • 0 comments

I have defined my lambda function handler as a method on a class. The py file that I want to use as the handler creates an instance of this class.

I want to be able to invoke that method like: python-lambda-local -f instance.method handler.py event.json

handler.py
class LambdaClass:
    def lambda_method(self, event, context):
        ... do stuff

instance = LambdaClass()

ksmoore17 avatar Dec 22 '20 02:12 ksmoore17