Skip to content

Commit 86e2178

Browse files
chore: Improve messages
1 parent 1dca6b3 commit 86e2178

File tree

4 files changed

+20
-21
lines changed

4 files changed

+20
-21
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Serverless is amazing and solves many issues with traditional systems. However,
2121

2222
Lambda Live Debugger connects to your deployed Lambda, routes requests to your computer, and sends responses back to the deployed Lambda. This allows you to debug locally, but the system behaves as if the code is running in the cloud with the same permissions. In case of code changes, you do not have to redeploy. The code is reloaded automatically without deploying or even restarting the debugger.
2323

24-
The tool attaches Lambda Extensions (via a Layer), intercepts, and relays calls to AWS IoT. AWS IoT transfers messages between your Lambda and the local machine. If the Lambda is written in TypeScript, it's transpiled to JavaScript. The code is executed via the Node Worker Thread.
24+
The tool attaches Lambda Extensions (via a layer), intercepts, and relays calls to AWS IoT. AWS IoT transfers messages between your Lambda and the local machine. If the Lambda is written in TypeScript, it's transpiled to JavaScript. The code is executed via the Node Worker Thread.
2525

2626
![Architecture](./public/architecture.drawio.png)
2727

@@ -34,11 +34,11 @@ AWS keys generated on the cloud for Lambda are transferred to the local environm
3434

3535
Lambda Live Debugger makes the following changes to your AWS infrastructure:
3636

37-
- Deploys the Lambda Layer
38-
- Attaches the Layer to each Lambda you're debugging
37+
- Deploys the Lambda layer
38+
- Attaches the layer to each Lambda you're debugging
3939
- Adds a policy to the Lambda Role for AWS IoT access
4040

41-
In case you do not want to debug all functions and add the Layer to them, you can limit to the ones you need via the `function` parameter.
41+
In case you do not want to debug all functions and add the layer to them, you can limit to the ones you need via the `function` parameter.
4242

4343
The tool generates temporary files in the `.lldebugger` folder, which can be deleted after debugging. The wizard can add `.lldebugger` to `.gitignore` for you.
4444

@@ -109,7 +109,7 @@ The configuration is saved to `lldebugger.config.ts`.
109109

110110
```
111111
-V, --version output the version number
112-
-r, --remove [option] Remove Lambda Live Debugger infrastructure. Options: 'keep-layer' (default), 'all'. The latest also removes the Lambda Layer
112+
-r, --remove [option] Remove Lambda Live Debugger infrastructure. Options: 'keep-layer' (default), 'all'. The latest also removes the Lambda layer
113113
-w, --wizard Program interactively asks for each parameter and saves it to lldebugger.config.ts
114114
-v, --verbose Verbose logging
115115
-c, --context <context> AWS CDK context (default: [])
@@ -187,9 +187,9 @@ When you no longer want to debug and want Lambda to execute the code deployed to
187187
lld -r
188188
```
189189

190-
This detaches the Layer from your Lambdas and removes the IoT permission policy. It will not remove the Layer because others might use it.
190+
This detaches the layer from your Lambdas and removes the IoT permission policy. It will not remove the layer because others might use it.
191191

192-
To also remove the Layer:
192+
To also remove the layer:
193193

194194
```
195195
lld -r=all

src/configuration/getConfigFromCliArgs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export async function getConfigFromCliArgs(
2020
program.name('lld').description('Lambda Live Debugger').version(version);
2121
program.option(
2222
'-r, --remove [option]',
23-
"Remove Lambda Live Debugger infrastructure. Options: 'keep-layer' (default), 'all'. The latest also removes the Lambda Layer",
23+
"Remove Lambda Live Debugger infrastructure. Options: 'keep-layer' (default), 'all'. The latest also removes the Lambda layer",
2424
//validateRemoveOption,
2525
//"keep-layer"
2626
);

src/infraDeploy.ts

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -146,23 +146,25 @@ async function findExistingLayerVersion() {
146146
nextMarker = response.NextMarker;
147147
} while (nextMarker);
148148

149-
Logger.verbose('No existing layer found.');
149+
Logger.verbose(
150+
`No matching layer version found with description ${layerDescription}`,
151+
);
150152

151153
return undefined;
152154
}
153155

154156
/**
155-
* Get the description of the Lambda Layer that is set to the layer
157+
* Get the description of the Lambda layer that is set to the layer
156158
* @returns
157159
*/
158160
async function getLayerDescription() {
159161
if (!layerDescription) {
160-
layerDescription = `Lambda Live Debugger Layer version ${await getVersion()}`;
162+
layerDescription = `Lambda Live Debugger layer version ${await getVersion()}`;
161163
}
162164

163165
if ((await getVersion()) === '0.0.1') {
164166
// add a random string to the description to make it unique
165-
layerDescription = `Lambda Live Debugger Layer - development ${crypto.randomUUID()}`;
167+
layerDescription = `Lambda Live Debugger layer - development ${crypto.randomUUID()}`;
166168
}
167169

168170
return layerDescription;
@@ -229,7 +231,7 @@ async function deployLayer() {
229231
}
230232

231233
/**
232-
* Delete the Lambda Layer
234+
* Delete the Lambda layer
233235
*/
234236
async function deleteLayer() {
235237
let nextMarker: string | undefined;
@@ -366,7 +368,6 @@ async function removePolicyFromLambdaRole(roleName: string) {
366368
PolicyName: inlinePolicyName,
367369
}),
368370
);
369-
Logger.verbose(`[Role ${roleName}] Policy removed successfully`);
370371
} catch (error: any) {
371372
throw new Error(`Failed to remove policy from the role ${roleName}.`, {
372373
cause: error,
@@ -402,9 +403,7 @@ async function createPolicyDocument(roleName: string) {
402403
}
403404
} catch (error: any) {
404405
if (error.name === 'NoSuchEntityException') {
405-
Logger.verbose(
406-
`[Role ${roleName}] Policy does not exist (NoSuchEntityException)`,
407-
);
406+
Logger.verbose(`[Role ${roleName}] Policy does not exist`);
408407
return undefined;
409408
} else {
410409
throw new Error(
@@ -837,7 +836,7 @@ async function analyzeLambdaAdd(
837836
});
838837

839838
Logger.verbose(
840-
`[Function ${functionName}] Layer does not exist at all, need to add it and attach to the function`,
839+
`[Function ${functionName}] The layer for this version does not exist in the account. We need to add it and attach it to the function`,
841840
);
842841

843842
return {
@@ -899,7 +898,7 @@ async function analyzeLambdaAdd(
899898
if (!environmentVariables || environmentVariables[key] !== value) {
900899
needToUpdate = true;
901900
Logger.verbose(
902-
`[Function ${functionName}] need to update environment variables`,
901+
`[Function ${functionName}] Need to update environment variables`,
903902
);
904903
break;
905904
}

src/lldebugger.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ async function run() {
8484
removalChanges.rolesToRemove.length ||
8585
Configuration.config.remove === 'all';
8686

87-
const changesMessage = `\nThe following changes will be applied to your AWS account:${
87+
const changesMessage = `The following changes will be applied to your AWS account:${
8888
(removalChanges.lambdasToRemove.length
8989
? `\n - Remove LLD layer and environment variables from Lambdas:\n${removalChanges.lambdasToRemove
9090
.map((l) => ` - ${l.functionName}`)
@@ -161,7 +161,7 @@ async function run() {
161161
changes.lambdasToRemove.length ||
162162
changes.rolesToRemove.length;
163163

164-
const changesMessage = `\nThe following changes will be applied to your AWS account:${
164+
const changesMessage = `The following changes will be applied to your AWS account:${
165165
(changes.deployLayer
166166
? `\n - Deploy Lambda Live Debugger layer version ${version}`
167167
: '') +

0 commit comments

Comments
 (0)