This is a stable example. It should successfully build out of the box
This example is built on Construct Libraries marked "Stable" and does not have any infrastructure prerequisites to build.
CDK example to create a NodeJS Lambda that uses a Lambda Layer. The example demonstrates use of Lambda Layer NodeJS folder structure, and use of L2 Constructs for deploying and using Lambda Layer with a function in CDK Typescript.
The cdk.json file tells the CDK Toolkit how to execute your app.
Before getting ready to deploy, ensure the dependencies are installed by executing the following:
$ npm install -g aws-cdk
$ npm install
A Lambda layer is a .zip file archive that can contain additional code or data. When deployed, CDK creates a layer .zip asset to be stored in a staging bucket managed by CDK. To enable this the AWS account being used needs to be bootstrapped.
With default profile,
$ cdk bootstrap
With specific profile,
$ cdk bootstrap --profile test
With the bootstrap complete, we are ready to deploy the lambda function and lambda layer.
$ cdk deploy