lambda-live-debugger 1.0.2 → 1.0.3
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/dist/cloudFormation.mjs
CHANGED
|
@@ -51,7 +51,11 @@ async function getCloudFormationClient(awsConfiguration) {
|
|
|
51
51
|
* @returns
|
|
52
52
|
*/
|
|
53
53
|
async function getCloudFormationResources(stackName, awsConfiguration) {
|
|
54
|
+
// temporary disable console.error because SAM framework outputs useless errors
|
|
55
|
+
const originalConsoleError = console.error;
|
|
56
|
+
console.error = function () { };
|
|
54
57
|
const { ListStackResourcesCommand } = await import('@aws-sdk/client-cloudformation');
|
|
58
|
+
console.error = originalConsoleError;
|
|
55
59
|
const cloudFormationClient = await getCloudFormationClient(awsConfiguration);
|
|
56
60
|
try {
|
|
57
61
|
let nextToken = undefined;
|
|
Binary file
|
|
@@ -209,6 +209,7 @@ export class CdkFramework {
|
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
211
|
const compileOutput = path.join(getProjectDirname(), outputFolder, `compiledCdk.${isESM ? 'mjs' : 'cjs'}`);
|
|
212
|
+
const dirname = path.join(...[getProjectDirname(), config.subfolder, 'x'].filter((p) => p));
|
|
212
213
|
try {
|
|
213
214
|
// Build CDK code
|
|
214
215
|
await esbuild.build({
|
|
@@ -229,7 +230,7 @@ export class CdkFramework {
|
|
|
229
230
|
`import { createRequire as topLevelCreateRequire } from 'module';`,
|
|
230
231
|
`global.require = global.require ?? topLevelCreateRequire(import.meta.url);`,
|
|
231
232
|
`import { fileURLToPath as topLevelFileUrlToPath, URL as topLevelURL } from "url"`,
|
|
232
|
-
`global.__dirname =
|
|
233
|
+
`global.__dirname = '${dirname}'`,
|
|
233
234
|
].join('\n'),
|
|
234
235
|
},
|
|
235
236
|
}
|
|
@@ -237,9 +238,7 @@ export class CdkFramework {
|
|
|
237
238
|
format: 'cjs',
|
|
238
239
|
target: 'node18',
|
|
239
240
|
banner: {
|
|
240
|
-
js: [
|
|
241
|
-
`__dirname = '${path.join(...[getProjectDirname(), config.subfolder, 'x'].filter((p) => p))}';`,
|
|
242
|
-
].join('\n'),
|
|
241
|
+
js: [`__dirname = '${dirname}';`].join('\n'),
|
|
243
242
|
},
|
|
244
243
|
}),
|
|
245
244
|
});
|
|
@@ -66,6 +66,24 @@ async function fixCdkPaths(awsCdkLibPath) {
|
|
|
66
66
|
const pathsFix = {
|
|
67
67
|
'custom-resource-handlers/': `${awsCdkLibPath}/custom-resource-handlers/`,
|
|
68
68
|
'aws-custom-resource-handler': `${awsCdkLibPath}/custom-resource-handlers/dist/custom-resources/aws-custom-resource-handler`,
|
|
69
|
+
'auto-delete-objects-handler': `${awsCdkLibPath}/custom-resource-handlers/dist/aws-s3/auto-delete-objects-handler`,
|
|
70
|
+
'notifications-resource-handler': `${awsCdkLibPath}/custom-resource-handlers/dist/aws-s3/notifications-resource-handler`,
|
|
71
|
+
'drop-spam-handler': `${awsCdkLibPath}/custom-resource-handlers/dist/aws-ses/drop-spam-handler`,
|
|
72
|
+
'aws-stepfunctions-tasks/role-policy-handler': `${awsCdkLibPath}/custom-resource-handlers/dist/aws-stepfunctions-tasks/role-policy-handler`,
|
|
73
|
+
'eval-nodejs-handler': `${awsCdkLibPath}/custom-resource-handlers/dist/aws-stepfunctions-tasks/eval-nodejs-handler`,
|
|
74
|
+
'cross-account-zone-delegation-handler': `${awsCdkLibPath}/custom-resource-handlers/dist/aws-route53/cross-account-zone-delegation-handler`,
|
|
75
|
+
'delete-existing-record-set-handler': `${awsCdkLibPath}/custom-resource-handlers/dist/aws-route53/delete-existing-record-set-handler`,
|
|
76
|
+
'aws-api-handler': `${awsCdkLibPath}/custom-resource-handlers/dist/aws-events-targets/aws-api-handler`,
|
|
77
|
+
'log-retention-handler': `${awsCdkLibPath}/custom-resource-handlers/dist/aws-logs/log-retention-handler`,
|
|
78
|
+
'cluster-resource-handler': `${awsCdkLibPath}/custom-resource-handlers/dist/aws-eks/cluster-resource-handler`,
|
|
79
|
+
'auto-delete-images-handler': `${awsCdkLibPath}/custom-resource-handlers/dist/aws-ecr/auto-delete-images-handler`,
|
|
80
|
+
'bucket-deployment-handler': `${awsCdkLibPath}/custom-resource-handlers/dist/aws-s3-deployment/bucket-deployment-handler`,
|
|
81
|
+
'nodejs-entrypoint-handler': `${awsCdkLibPath}/custom-resource-handlers/dist/core/nodejs-entrypoint-handler`,
|
|
82
|
+
'restrict-default-security-group-handler': `${awsCdkLibPath}/custom-resource-handlers/dist/aws-ec2/restrict-default-security-group-handler`,
|
|
83
|
+
'dns-validated-certificate-handler': `${awsCdkLibPath}/custom-resource-handlers/dist/aws-certificatemanager/dns-validated-certificate-handler`,
|
|
84
|
+
'auto-delete-underlying-resources-handler': `${awsCdkLibPath}/custom-resource-handlers/dist/aws-synthetics/auto-delete-underlying-resources-handler`,
|
|
85
|
+
'replica-handler': `${awsCdkLibPath}/custom-resource-handlers/dist/aws-dynamodb/replica-handler`,
|
|
86
|
+
'oidc-handler': `${awsCdkLibPath}/custom-resource-handlers/dist/aws-iam/oidc-handler`,
|
|
69
87
|
};
|
|
70
88
|
|
|
71
89
|
// Create a proxy to intercept calls to the path module so we can fix paths
|
|
@@ -90,6 +108,23 @@ async function fixCdkPaths(awsCdkLibPath) {
|
|
|
90
108
|
|
|
91
109
|
return resolvedPath;
|
|
92
110
|
}
|
|
111
|
+
if (prop === 'join') {
|
|
112
|
+
let resolvedPath = target[prop].apply(target, args);
|
|
113
|
+
|
|
114
|
+
for (const [key, value] of Object.entries(pathsFix)) {
|
|
115
|
+
if (resolvedPath.includes(key)) {
|
|
116
|
+
// replace the beginning of the path with the value
|
|
117
|
+
const i = resolvedPath.indexOf(key);
|
|
118
|
+
const newResolvedPath = `${value}${resolvedPath.substring(i + key.length)}`;
|
|
119
|
+
Logger.verbose(
|
|
120
|
+
`[CDK] [Worker] Fixing path ${resolvedPath} -> ${newResolvedPath}`,
|
|
121
|
+
);
|
|
122
|
+
resolvedPath = newResolvedPath;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return resolvedPath;
|
|
127
|
+
}
|
|
93
128
|
return target[prop].apply(target, args);
|
|
94
129
|
};
|
|
95
130
|
}
|