@@ -414,9 +414,6 @@ export class ServerlessSpy extends Construct {
414414 const layerKey = ( r : lambda . Runtime , a : lambda . Architecture ) =>
415415 `${ r . toString ( ) } _${ a . name . toString ( ) } ` ;
416416
417- console . log ( 'RUNTIME: ' , runtime ) ;
418- console . log ( 'ARCHITECTURE: ' , architecture ) ;
419-
420417 let layer = this . layerMap [ layerKey ( runtime , architecture ) ] ;
421418 let spyWrapperPath = '/opt/spy-wrapper' ;
422419
@@ -430,20 +427,26 @@ export class ServerlessSpy extends Construct {
430427 spyWrapperPath = '/opt/python/spy-wrapper' ;
431428 layer =
432429 layer ||
433- new PythonLayerVersion ( this , 'PythonExtension' , {
434- compatibleRuntimes : [ runtime ] ,
435- compatibleArchitectures : [ architecture ] ,
436- entry : location ,
437- bundling : {
438- bundlingFileAccess : BundlingFileAccess . VOLUME_COPY ,
439- // command: [
440- // `cp ${path.join(
441- // location.substring(0, location.lastIndexOf(path.sep)),
442- // 'spy-wrapper/spy-wrapper'
443- // )} /asset-output/python`,
444- // ],
445- } ,
446- } ) ;
430+ new PythonLayerVersion (
431+ this ,
432+ `PythonExtension${ runtime . name
433+ . replace ( 'python' , '' )
434+ . replace ( '.' , '_' ) } `,
435+ {
436+ compatibleRuntimes : [ runtime ] ,
437+ compatibleArchitectures : [ architecture ] ,
438+ entry : location ,
439+ bundling : {
440+ bundlingFileAccess : BundlingFileAccess . VOLUME_COPY ,
441+ // command: [
442+ // `cp ${path.join(
443+ // location.substring(0, location.lastIndexOf(path.sep)),
444+ // 'spy-wrapper/spy-wrapper'
445+ // )} /asset-output/python`,
446+ // ],
447+ } ,
448+ }
449+ ) ;
447450 break ;
448451 case lambda . Runtime . NODEJS_12_X . name :
449452 case lambda . Runtime . NODEJS_14_X . name :
0 commit comments