Skip to content

Commit 5db4b8a

Browse files
Merge pull request #52 from ServerlessLife/51-fix-lambda-aliase
fix: lambda aliase #51
2 parents f8e1cef + 22534b4 commit 5db4b8a

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/ServerlessSpy.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export interface SpyFilter {
5050
}
5151

5252
const isLambdaFunction = (node: IConstruct): node is lambda.Function =>
53-
'functionName' in node && 'functionArn' in node;
53+
'functionName' in node && 'functionArn' in node && 'runtime' in node;
5454

5555
const serverlessSpyIotEndpointCrNamePrefix = 'ServerlessSpyIotEndpoint';
5656

@@ -413,6 +413,10 @@ export class ServerlessSpy extends Construct {
413413
): { layer: lambda.ILayerVersion; spyWrapperPath: string } | undefined {
414414
const layerKey = (r: lambda.Runtime, a: lambda.Architecture) =>
415415
`${r.toString()}_${a.name.toString()}`;
416+
417+
console.log('RUNTIME: ', runtime);
418+
console.log('ARCHITECTURE: ', architecture);
419+
416420
let layer = this.layerMap[layerKey(runtime, architecture)];
417421
let spyWrapperPath = '/opt/spy-wrapper';
418422

test/cdk/src/lambdaStack.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export class LambdaStack extends Stack {
2020
NODE_OPTIONS: '--enable-source-maps',
2121
},
2222
});
23+
func.addAlias('live');
2324

2425
// use uncommon name
2526
const func2 = new NodejsFunction(this, 'my_lambda-TestName_2', {

0 commit comments

Comments
 (0)