import * as cdk from '@aws-cdk/core' ; import * as lambda from '@aws-cdk/aws-lambda-nodejs' ; import * as path from "path" ; export class NodeLambdaTimeviewerStack extends cdk . Stack { constructor ( scope , id , props ? ) { super ( scope , id , props ) ; new lambda . NodejsFunction ( this , 'TimeViewer' , { entry : path . resolve ( __dirname , '../src/time-viewer.ts' ) , functionName : 'timeViewer' , handler : 'handler' , memorySize : 512 , timeout : cdk . Duration . seconds ( 10 ) , bundling : { minify : true , sourceMap : true , sourceMapMode : lambda . SourceMapMode . INLINE , sourcesContent : false , target : 'es2020' , define : { 'process.env.COUNTRY' : JSON . stringify ( 'France' ) , } , } } ) ; } }