aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
2 lines (1 loc) • 704 B
JavaScript
;Object.defineProperty(exports,"__esModule",{value:!0});const path=require("path"),cdk=require("../../core"),lambda=require("../lib"),app=new cdk.App,stack=new cdk.Stack(app,"aws-cdk-layer-version-1"),awsAccountId=stack.account,layer=new lambda.LayerVersion(stack,"MyLayer",{code:lambda.Code.fromAsset(path.join(__dirname,"layer-code")),compatibleRuntimes:[lambda.Runtime.NODEJS_14_X],license:"Apache-2.0",description:"A layer to test the L2 construct"});layer.addPermission("remote-account-grant",{accountId:awsAccountId}),new lambda.Function(stack,"MyLayeredLambda",{code:new lambda.InlineCode("foo"),handler:"index.handler",runtime:lambda.Runtime.NODEJS_14_X,layers:[layer]}),app.synth();