import * as cdk from '@aws-cdk/core' ; import sam = require ( '@aws-cdk/aws-sam' ) ; import lambda = require ( '@aws-cdk/aws-lambda' ) ; export class TheLambdaPowerTunerStack extends cdk . Stack { constructor ( scope , id , props ? ) { super ( scope , id , props ) ; let powerValues = '128,256,512,1024,1536,3008' ; let lambdaResource = "*" ; let exampleLambda = new lambda . Function ( this , 'lambdaHandler' , { runtime : lambda . Runtime . NODEJS_12_X , code : lambda . Code . fromInline ( 'exports.handler = function(event, ctx, cb) { return cb(null, "hi"); }' ) , handler : 'index.handler' } ) ; new cdk . CfnOutput ( this , 'LambdaARN' , { value : exampleLambda . functionArn } ) ; new sam . CfnApplication ( this , 'powerTuner' , { location : { applicationId : 'arn:aws:serverlessrepo:us-east-1:451282441545:applications/aws-lambda-power-tuning' , semanticVersion : '3.4.0' } , parameters : { "lambdaResource" : lambdaResource , "PowerValues" : powerValues } } ) ; } }