Summary: AWS CDK v2 Developer Preview announcement

03 May 2021 — Written by Eddy

After a fantastic CDK Day, it's time to unpack all the announcements, cool tools and demos shared during the presentations.

So let's start with the biggest one of them all, the release of the Developer Preview of AWS CDK v2. 🔥 Party

Here is the official announcement blog.

AWS CDK v2 is in Developer Preview

The AWS CDK v2 is now in Developer Preview for all supported languages (TypeScript, Python, Java, C#, and Go). With the version: aws-cdk@2.0.0-rc.1 as release candidate like the beta version of the new AWS CDK v2.

The End of dependency errors

Okay, maybe not all dependency errors...

Instead of installing a million (at least it feels like it) packages to use the AWS CDK and trying to keep them up to date:

  "dependencies": {
    "@aws-cdk/aws-ec2": "1.101.0",
    "@aws-cdk/aws-elasticloadbalancingv2": "1.101.0",
    "@aws-cdk/core": "1.101.0"
   }
import * as ec2 from '@aws-cdk/aws-ec2';
import * as elb from '@aws-cdk/aws-elasticloadbalancingv2';
import * as coree from '@aws-cdk/core';

The new version comes as a handy single package that contains all other libraries (think EC2, IAM, S3): aws-cdk-lib

  "dependencies": {
        "aws-cdk-lib": "^2.0.0-rc.1",
        "@aws-cdk/assert": "^2.0.0-rc.1",
        "constructs": "^10.0.0"
     }
import { Construct }  from 'constructs';
import { App, Stack, aws_s3 as s3 } from 'aws-cdk-lib';

All stable libraries are now included in the aws-cdk-lib package. You can see if a construct is stable in the documentation

stable CDK-construct banner

Experimental Libraries

What's important is that experimental APIs (like aws-amplify), are not part of the main aws-cdk-lib. Those will be published as a separate package under @aws-cdk-experiments/aws-package-name

experimental CDK-construct banner

And with the separation of stable and experimental constructs, there will be no breaking changes in v2 in minor version releases. So updating to a newer release of the AWS CDK will be easy peasy.

That's all and I recommend you to go ahead and read about all the changes and so much more in details in the official blogpost.

Big congratulations 🎉 to the developer team for this important milestone and the fantastic changes and I'm really looking forward to trying it out.

© 2021 Built with ❤️