lambda-live-debugger 0.0.90 → 0.0.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CNAME +1 -0
- package/README.md +78 -78
- package/_config.yml +1 -0
- package/dist/extension/extension.zip +0 -0
- package/package.json +1 -1
package/CNAME
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
www.lldebugger.com
|
package/README.md
CHANGED
|
@@ -2,128 +2,128 @@
|
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|
|
|
5
|
-
Lambda Live Debugger is indispensable tool that allows you to debug AWS Lambda from your computer
|
|
5
|
+
Lambda Live Debugger is an indispensable tool that allows you to debug AWS Lambda from your computer, although it is deployed on the cloud. It supports Lambdas written in JavaScript or TypeScript.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
This is essentially the same as offered by [SST](https://sst.dev/) and [Serverless Framework v4](https://www.serverless.com/blog/serverless-framework-v4-general-availability), except it supports an additional Obserability mode.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
- AWS
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
9
|
+
It supports the following frameworks:
|
|
10
|
+
|
|
11
|
+
- AWS CDK v2,
|
|
12
|
+
- Serverless Framework v3 (SLS),
|
|
13
|
+
- AWS Serverless Application Model (SAM),
|
|
14
|
+
- Terraform,
|
|
15
|
+
- by implementing a simple function and option to support any framework or setup you might have,
|
|
16
|
+
- ... (if you need any other framework, let me know?)
|
|
15
17
|
|
|
16
18
|
## Early alpha state
|
|
17
19
|
|
|
18
|
-
**Currently the project is in early alpha state. Please let me know if
|
|
20
|
+
**Currently, the project is in the early alpha state. Please let me know if everything works for you. A simple message would help a lot, so I know I am on the right track. I tested many scenarios, but there are numerous ways how people can configure projects and TypeScript configuration. The tool is flexible enough, so the settings can be tweaked to adjust your setup without implementing additional features. Any advice on how to improve the project is also very welcome.**
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
You can contact me by:
|
|
21
23
|
|
|
22
24
|
- [Open GitHub issue](https://github.com/ServerlessLife/lambda-live-debugger/issues)
|
|
23
25
|
- [LinkedIn](http://www.linkedin.com/in/marko-serverlesslife)
|
|
24
26
|
|
|
25
27
|
## The problem statement
|
|
26
28
|
|
|
27
|
-
The
|
|
28
|
-
|
|
29
|
-
Tools like [SST](https://sst.dev/) and [Serverless Framework V4](https://www.serverless.com/blog/serverless-framework-v4-general-availability) has the exact same functionality (without Observability mode). But other tools do not have it.
|
|
29
|
+
The serverless is amazing and resolves many issues that regular systems face. But writing code can be a struggle. You write code, deploy, run, fix, deploy again. That process is time-consuming and tiresome. You can also use one of the tools for running code locally or use unit/integration tests for that, but that has many other issues, and it does not mimic an actual environment close enough.
|
|
30
30
|
|
|
31
31
|
## How does it work
|
|
32
32
|
|
|
33
|
-
It
|
|
33
|
+
It connects to your deployed Lambda, sends the request to your computer, and sends the response back to Lambda. This way, you can debug on your machine, but the system behaves as if the code is running in the cloud with the same permissions.
|
|
34
34
|
|
|
35
|
-
Lambda Live Debugger
|
|
35
|
+
Lambda Live Debugger attaches Lambda Extensions (via Layer) to the Lambda to intercept calls and send them to AWS IoT. AWS IoT is used to transfer messages to and from your machine. Lambda Live Debugger runs locally, connects to the AWS IoT, and executes the code locally. If Lambda is written in TypeScript, it is transpiled to JavaScript. Calls are executed via Node Worker Threads.
|
|
36
36
|
|
|
37
37
|

|
|
38
38
|
|
|
39
|
-
Lambda Live Debugger makes the
|
|
39
|
+
Lambda Live Debugger makes the following changes to your AWS infrastructure:
|
|
40
40
|
|
|
41
41
|
- Lambda excentions as a Layer
|
|
42
42
|
- Attach Layer to each Lambda that you are debugging
|
|
43
43
|
- Add policy to Lambda Role to use AWS IoT
|
|
44
44
|
|
|
45
|
-
In case you do not want to add Layer to all functions you can limit to
|
|
45
|
+
In case you do not want to add Layer to all functions, you can limit to the ones you need via configuration parameters.
|
|
46
46
|
|
|
47
|
-
While compiling it creates
|
|
47
|
+
While compiling, it creates many temporary files in the folder `.lldebugger`; you can freely delete the folder once you are done debugging or add `.lldebugger` to `.gitignore`. The wizard adds that for you if you want.
|
|
48
48
|
|
|
49
49
|
## Your developing process with Lambda Live Debugger
|
|
50
50
|
|
|
51
|
-
Since you will be
|
|
51
|
+
Since you will be deploying code into an actual AWS account while developing, you must use that environment only for yourself or create a temporary environment for you or for a feature you are working on.
|
|
52
52
|
|
|
53
|
-
Unfortunately
|
|
53
|
+
Unfortunately, having a separate AWS environment is not always possible because of organizational issues (it is 2024, and companies still do not understand how to work with serverless) or technical issues (it is hard to duplicate databases or other parts of the system). For that purpose, there is an Observability Mode.
|
|
54
54
|
|
|
55
55
|
## Observability Mode
|
|
56
56
|
|
|
57
|
-
In Observability Mode Lambda Live Debugger via Lambda Extension just
|
|
57
|
+
In Observability Mode, Lambda Live Debugger via Lambda Extension just intercepts the request received by Lambda and forwards it to the local environment, but it does not wait for the response. After that, Lambda continues regular execution and ignores the response from the local environment. The system is not impacted, and regular users and other developers can continue to use it. You can run Observability Mode on the development or testing environment. If you are an adventurer, you can even run it in production. In observability mode, you do not get all Lambda requests. You only get one every 3 seconds. You can configure that interval via `interval` setting. This way, the system will not be overloaded if there are a lot of requests coming in.
|
|
58
58
|
|
|
59
59
|
## How to start
|
|
60
60
|
|
|
61
61
|
### Installation
|
|
62
62
|
|
|
63
|
-
Install
|
|
63
|
+
Install locally:
|
|
64
64
|
`npm install lambda-live-debugger`
|
|
65
|
-
or
|
|
65
|
+
or globally
|
|
66
66
|
`npm install lambda-live-debugger -g` (Linux, Mac: `sudo npm install lambda-live-debugger -g`)
|
|
67
67
|
|
|
68
68
|
### How to run
|
|
69
69
|
|
|
70
|
-
If you use default profile, default region and other default
|
|
70
|
+
If you use the default profile, default region, and other default settings then just run:
|
|
71
71
|
|
|
72
|
-
`
|
|
72
|
+
`lld` or `npx lld` (if installed locally)
|
|
73
73
|
|
|
74
|
-
But you probably need to tweak some
|
|
74
|
+
But you probably need to tweak some settings. You can do it via CLI parameters or, better run a wizard. The configuration is saved to `lldebugger.config.ts`
|
|
75
75
|
|
|
76
|
-
`npx lld -w` or `lld -w` (if installed
|
|
76
|
+
`npx lld -w` or `lld -w` (if installed globally)
|
|
77
77
|
|
|
78
78
|
### CLI parameters
|
|
79
79
|
|
|
80
80
|
```
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
81
|
+
-V, --version output the version number
|
|
82
|
+
-r, --remove [option] Remove Lambda Live Debugger infrastructure. Options: 'keep-layer' (default),
|
|
83
|
+
'remove-all'
|
|
84
|
+
-w, --wizard Program interactively asks for each parameter
|
|
85
|
+
-v, --verbose Verbose logs
|
|
86
|
+
-c, --context <context> AWS CDK context (default: [])
|
|
87
|
+
-s, --stage <stage> Serverless Framework stage
|
|
88
|
+
-f, --function <function name> Filter by function name
|
|
89
|
+
-m, --subfolder <subfolder> Monorepo subfolder
|
|
90
|
+
-o, --observable Observable mode
|
|
91
|
+
-i --interval <interval> Observable mode interval (default: "3000")
|
|
92
|
+
--config-env <evironment> SAM environment
|
|
93
|
+
--profile <profile> AWS profile to use
|
|
94
|
+
--region <region> AWS region to use
|
|
95
|
+
--role <role> AWS role to use
|
|
96
|
+
--framework <framework> Framework to use (cdk, sls, sam, terraform)
|
|
97
|
+
--gitignore Add .lldebugger to .gitignore
|
|
98
|
+
-h, --help display help for command
|
|
99
99
|
```
|
|
100
100
|
|
|
101
101
|
### Debugging
|
|
102
102
|
|
|
103
|
-
You might want to configure
|
|
103
|
+
You might want to configure your development tool for debugging. The wizard automatically configures for VsCode in `.vscode/launch.json`. Here is an example:
|
|
104
104
|
|
|
105
105
|
```
|
|
106
106
|
{
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
107
|
+
"version": "0.2.0",
|
|
108
|
+
"configurations": [
|
|
109
|
+
|
|
110
|
+
{
|
|
111
|
+
"name": "Lambda Live Debugger",
|
|
112
|
+
"type": "node",
|
|
113
|
+
"request": "launch",
|
|
114
|
+
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/lld",
|
|
115
|
+
"runtimeArgs": [],
|
|
116
|
+
"console": "integratedTerminal",
|
|
117
|
+
"skipFiles": [
|
|
118
|
+
"<node_internals>/**"
|
|
119
|
+
],
|
|
120
|
+
"env": {}
|
|
121
|
+
},
|
|
122
|
+
]
|
|
123
123
|
}
|
|
124
124
|
```
|
|
125
125
|
|
|
126
|
-
If you are using another tool, please send me
|
|
126
|
+
If you are using another tool, please send me documentation so I can include it here. Especially the instruction for WebStorm is needed.
|
|
127
127
|
|
|
128
128
|
### Monorepo
|
|
129
129
|
|
|
@@ -141,28 +141,28 @@ getLambdas: async (foundLambdas) => {
|
|
|
141
141
|
You can remove Lambda Live Debugger from your AWS account by running:
|
|
142
142
|
`lld -r` (`npx lld -r` if installed locally)
|
|
143
143
|
|
|
144
|
-
This will
|
|
144
|
+
This will detach the Layer from your Lambda and remove the additional IoT permission policy.
|
|
145
145
|
|
|
146
|
-
It will not remove the Layer as
|
|
146
|
+
It will not remove the Layer as others might use it. You can do everything, including Layer, with:
|
|
147
147
|
`lld -r=all` (`npx lld -r=all` if installed locally)
|
|
148
148
|
|
|
149
149
|
## AWS CDK v2
|
|
150
150
|
|
|
151
|
-
`context` is an additional setting for CDK. This a common way to pass
|
|
151
|
+
`context` is an additional setting for CDK. This is a common way to pass various variables to your code, most often the environment name.
|
|
152
152
|
|
|
153
153
|
## Serverless Framework v3 (SLS)
|
|
154
154
|
|
|
155
|
-
`stage` is an additional setting for SLS to pass the stage/
|
|
155
|
+
`stage` is an additional setting for SLS to pass the stage/environment name to SLS.
|
|
156
156
|
|
|
157
157
|
## AWS Serverless Application Model (SAM)
|
|
158
158
|
|
|
159
|
-
`config-env` is an additional setting for SAM to pass the stage/
|
|
159
|
+
`config-env` is an additional setting for SAM to pass the stage/environment name to SLS.
|
|
160
160
|
|
|
161
161
|
## Terraform
|
|
162
162
|
|
|
163
|
-
Only the most
|
|
163
|
+
Only the most basic setup for Terraform is supported. Check the test case [in](https://github.com/ServerlessLife/lambda-live-debugger/tree/main/test/terraform-basic).
|
|
164
164
|
|
|
165
|
-
I am not a Terraform developer, so I only know
|
|
165
|
+
I am not a Terraform developer, so I only know the basics. Please provide a project sample so I can build better support.
|
|
166
166
|
|
|
167
167
|
## Know issues
|
|
168
168
|
|
|
@@ -170,24 +170,24 @@ I am not a Terraform developer, so I only know basis. Please provide a project s
|
|
|
170
170
|
|
|
171
171
|
Please check the open [issues](https://github.com/ServerlessLife/lambda-live-debugger/issues).
|
|
172
172
|
|
|
173
|
-
The most
|
|
173
|
+
The most important missing feature is MFA authentication and the most possible configuration for Terraform.
|
|
174
174
|
|
|
175
175
|
## Reporting an issue
|
|
176
176
|
|
|
177
|
-
- Make sure the bug is not already reported. Add +1 comment so I know there are multiple users
|
|
178
|
-
- Make a descriptive title with prefix "bug:", "help:", "feature:", "discussion:" to indicate if you find a bug, need help, propose feature... Please also add the matching label and if needed set
|
|
179
|
-
- Turn on verbose logging and provide whole log.
|
|
180
|
-
-
|
|
177
|
+
- Make sure the bug is not already reported. Add +1 comment so I know there are multiple users struggling with the same issue. If possible, add some additional info.
|
|
178
|
+
- Make a descriptive title with the prefix "bug:", "help:", "feature:", "discussion:" to indicate if you find a bug, need help, propose a feature... Please also add the matching label and, if needed, set priority via label.
|
|
179
|
+
- Turn on verbose logging and provide the whole log.
|
|
180
|
+
- Carefully describe your setup, or even better, provide a sample project.
|
|
181
181
|
|
|
182
182
|
## Authors:
|
|
183
183
|
|
|
184
184
|
- [Marko (ServerlessLife)](https://github.com/ServerlessLife)
|
|
185
|
-
-
|
|
185
|
+
- ⭐ place for you for large code contribution
|
|
186
186
|
|
|
187
187
|
## Contributors (alphabetical)
|
|
188
188
|
|
|
189
|
-
-
|
|
189
|
+
- ⭐ place for you for smaller code/documentation contributions or a sample project as a part of a bug report
|
|
190
190
|
|
|
191
191
|
## Declarment
|
|
192
192
|
|
|
193
|
-
Use this tool at your
|
|
193
|
+
Use this tool at your responsibility...
|
package/_config.yml
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
theme: jekyll-theme-primer
|
|
Binary file
|