DEV Community

Joseph Snell
Joseph Snell

Posted on

Introducing `bump-cdk`


From a directory that contains a package.json with aws-cdk dependencies run:

$ npx bump-cdk

You should now have those dependencies upgraded and pinned to the same version!

You can check out the source here.

Why does this exist

A common issue when working with AWS CDK is version mismatch.

The way CDK's modules interface together requires them to always be on the same version More Information.

This for example might cause an error:

    "dependencies": {
        "@aws-cdk/core": "1.30.0",
        "@aws-cdk/aws-lambda": "1.51.0"

This introduces maintenance overhead by forcing you to always have your CDK dependencies on the same version.

Additionally, because of semver, when you add dependencies, you often end up with a dynamic version range:

$ yarn add @aws-cdk/core
    "dependencies": {
        "@aws-cdk/core": "^1.30.0"

This means that the module is "Compatible with version" 1.30.0, but dependencies added at a later date can get out of sync.

Because of all this, it is recommended to pin the versions without the semver range modifier.


Feel free to check it out, and if you find any issues or have suggestions feel free to open an issue.

Discussion (0)