No module named 'lambda_function'
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 807
- Avg merge
- 10h 12m
- Merged PRs (30d)
- 7
Description
**Describe the bug**
lambda_function is not locatable when executed from aws lambda console when locally things work fine.
**To Reproduce**
**Expected behavior**
Lambda should execute without giving this error: No module named 'lambda_function'
**Screenshots**
Attaching
[StripeWebhookProcessor.tgz: Use this to open vcode and upload to lambda](https://github.com/aws/aws-toolkit-visual-studio/files/14662013/StripeWebhookProcessor.tgz)
**Toolkit Logs**
If applicable, attach toolkit logs by navigating to Extensions / AWS Toolkit / View Toolkit Logs: This navigation is not showing up.
I have checked the folder and adding following files from the folder ~/Library/Application Support/Code/logs/20240320T084750 for whatever executed today (20Mar). If something else is reqd let me know.
[.//window3/exthost/amazonwebservices.aws-toolkit-vscode/aws_toolkit_20240320T084758.log](https://github.com/aws/aws-toolkit-visual-studio/files/14662067/aws_toolkit_20240320T084757.log)
[.//window2/exthost/amazonwebservices.aws-toolkit-vscode/aws_toolkit_20240320T084759.log](https://github.com/aws/aws-toolkit-visual-studio/files/14662068/aws_toolkit_20240320T084758.log)
[.//window1/exthost/amazonwebservices.aws-toolkit-vscode/aws_toolkit_20240320T084757.log](https://github.com/aws/aws-toolkit-visual-studio/files/14662069/aws_toolkit_20240320T084759.log)
**Development System (please complete the following information):**
- macOS Version:14.2 Beta (23C5047e)
- Visual Studio Version: Version: 1.86.2 (Universal), Commit: 903b1e9d8990623e3d7da1df3d33db3e42d80eda, V8: 11.8.172.18-electron.0, OS: Darwin x64 23.2.0
- AWS Toolkit for Visual Studio Version: 2.15.0
**Additional context**
Following are few things I want to rectify wrt the files template.yaml, samconfig.toml using cli or click buttons rather than manually editing the file. How to do these?
* I renamed the folder/project to StripeWebhookProcessor from StripeInBackend via VisualStudio. How to ensure this renaming is taken care in config files.
* Name the function resource as StripeBackendFunction from existing HelloWorldFunction.
* Update the CodeUri from hello_world/ to something meangingful like stripe_webhook/. (what does this mean?)
* Update Events section to more meaningful word.
* Also, I had put in three event files under events/ folder. After right-click-and-upload, these are not even visible in the AWS Lambda console. Over a period of attempts and checking, I had tried these few times and once the default event.json was observed to uploaded and visible at aws console.
Thanks
Contributor guide
Research direction
Start by examining the attached StripeWebhookProcessor.tgz project, especially template.yaml, samconfig.toml, the hello_world folder, and events/event1.json. Reproduce the difference between sam local invoke and the Toolkit's Upload Lambda action, then use the attached Toolkit logs to trace packaging or configuration. Done means the uploaded function runs in the AWS Lambda console and the expected event files are available there.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, python, typescript, vscode
- Domain
- cloud, devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100