v41.0.0
41.0.0 (2022-04-11)
BREAKING CHANGES
- Update AWS CDK to v2
To update existing projects:
-
Update
package.json
:- Replace all
@aws-cdk/*
dependencies with the singleaws-cdk-lib
dependency - Add
constructs
dependency - Upgrade your
aws-cdk
version so that it matches the version ofaws-cdk-lib
- See
peerDependencies
for version numbers
- Replace all
-
Fix imports
npx -p aws-cdk-migration rewrite-imports-v2 **/*.ts
-
Update
cdk.json
, removing deprecated feature flags such as@aws-cdk/core:enableStackNameDuplicates
-
Update snapshot tests:
From:
import { SynthUtils } from "@aws-cdk/assert"; expect(SynthUtils.toCloudFormation(stack)).toMatchSnapshot();
To:
import { Template } from "aws-cdk-lib/assertions"; expect(Template.fromStack(stack).toJSON()).toMatchSnapshot();