How to locally trigger aws Lambda function?

488 Views Asked by At

I have a Greengrass Core device and on it I deployed a simple Lambda function but I don't know how to locally trigger it. Is it even possible?

I am looking for a command line call, something like this: "aws lambda invoke --function-name my-math-function --payload '{"action": "square","number": 3}' output.txt" but this one triggers a lambda function that is defined in the cloud. I want to trigger my locally running lambda (deployed as a component in greengrass).

1

There are 1 best solutions below

1
On BEST ANSWER

You can manage AWS Greengrass Lambda functions with AWS Serverless Application Model(SAM). Please refer to the link here: Managing Greengrass Lambda Code With AWS SAM

You can invoke your function locally by using the sam local invoke command