diff --git a/src/ServerlessSpy.ts b/src/ServerlessSpy.ts index a22cd7d..f2a61c8 100644 --- a/src/ServerlessSpy.ts +++ b/src/ServerlessSpy.ts @@ -50,7 +50,7 @@ export interface SpyFilter { } const isLambdaFunction = (node: IConstruct): node is lambda.Function => - 'functionName' in node && 'functionArn' in node; + 'functionName' in node && 'functionArn' in node && 'runtime' in node; const serverlessSpyIotEndpointCrNamePrefix = 'ServerlessSpyIotEndpoint'; @@ -413,6 +413,10 @@ export class ServerlessSpy extends Construct { ): { layer: lambda.ILayerVersion; spyWrapperPath: string } | undefined { const layerKey = (r: lambda.Runtime, a: lambda.Architecture) => `${r.toString()}_${a.name.toString()}`; + + console.log('RUNTIME: ', runtime); + console.log('ARCHITECTURE: ', architecture); + let layer = this.layerMap[layerKey(runtime, architecture)]; let spyWrapperPath = '/opt/spy-wrapper'; diff --git a/test/cdk/src/lambdaStack.ts b/test/cdk/src/lambdaStack.ts index 86184a8..27c629c 100644 --- a/test/cdk/src/lambdaStack.ts +++ b/test/cdk/src/lambdaStack.ts @@ -20,6 +20,7 @@ export class LambdaStack extends Stack { NODE_OPTIONS: '--enable-source-maps', }, }); + func.addAlias('live'); // use uncommon name const func2 = new NodejsFunction(this, 'my_lambda-TestName_2', {