Posted On: Apr 30, 2021

The AWS Cloud Development Kit (AWS CDK) v2 is now available for Developer Preview, and offers two new capabilities for CDK users. The first is all CDK versions now support Go, expanding the number of programming languages developers can use to define infrastructure-as-code, and provision through AWS CloudFormation. The second is that all stable constructs from the AWS Construct Library are now available in a single, separate package, making it easier for you to use the CDK and stay up-to-date with new versions as we evolve it going forwards.

AWS CDK v2 consolidates the AWS Construct Library into a single package called aws-cdk-lib, and eliminates the need to download individual packages for each AWS service used. If you write your own CDK construct libraries, you only need to take a minimum dependency on this single package and let library consumers choose which exact AWS CDK version to use. In addition, AWS CDK v2 only includes stable APIs, which comply with Semantic Versioning (semver), so you can confidently update to new minor versions. Going forward, experimental modules will be distributed separately from aws-cdk-lib, and versioned clearly to indicate their pre-release status, and will be merged into aws-cdk-lib when mature and stable. 

Upgrading to AWS CDK v2, for most projects, can be accomplished with a one-time, safe re-bootstrapping of your AWS accounts and “import“ statement changes. To learn more, refer to the following resources: