Search code examples
amazon-web-servicespackageaws-cdknpm-packageaws-cdk-typescript

Difference between aws-cdk and aws-cdk-lib packages


In the package.json of my application I see two different packages named aws-cdk and aws-cdk-lib. What is the difference between both of them?


Solution

  • Going to npmjs.com and checking the descriptions of both packages should give you the answer:

    aws-cdk:

    The AWS CDK Toolkit provides the cdk command-line interface that can be used to work with AWS CDK applications.

    aws-cdk-lib:

    The AWS CDK construct library provides APIs to define your CDK application and add CDK constructs to the application.

    The former is the AWS CDK CLI, so you don't necessarily need to have it in your package.json if you install it globally.

    The latter is the actual AWS CDK framework that houses all the constructs.