'Is there any way to debug lambda function with s3 trigger locally?
I want to debug my application by breakpoints and this lambda function is triggered by uploading to s3 bucket. Is there any way to debug locally with breakpoints without making the request by hand ? As it is really slow to deploy and test by printing the values.
I am using python for this (but probably it does not matter)
Solution 1:[1]
Have you tried using the sam local generate-event command from SAM cli? The command below shows how to generate a JSON file that you can then pass to the local invoke command to trigger the local function.
sam local generate-event s3 put --bucket bucket-name --key key-name > event_file.json
Then you invoke your function with the payload:
sam local invoke function-name -e event_file.json
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Allan Chua |
