Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: aws/aws-cdk-cli
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: aws-cdk@v2.1105.0
Choose a base ref
...
head repository: aws/aws-cdk-cli
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: aws-cdk@v2.1106.0
Choose a head ref
  • 8 commits
  • 36 files changed
  • 6 contributors

Commits on Feb 5, 2026

  1. docs: update contributing guide to reflect minimum node versions for …

    …contributors (#1122)
    
    Fixes incorrect info in CONTRIBUTING.md.
    
    In
    ba59816,
    we upgraded our dependency `npm` from major version 10 to 11. This
    changed our Node version requirement to:
    - `^20.17.0`
    - `>=22.9.0`
    
    ---
    By submitting this pull request, I confirm that my contribution is made
    under the terms of the Apache-2.0 license
    iankhou authored Feb 5, 2026
    Configuration menu
    Copy the full SHA
    e274b37 View commit details
    Browse the repository at this point in the history

Commits on Feb 9, 2026

  1. feat(cli): metadata can live in a separate file (#568)

    When CDK apps grow extremely large (think 10-100 stacks, 1000-10000
    constructs), all metadata together begins to exceed 512MB, the maximum
    string size in NodeJS. People usually deal with this by disabling
    metadata, but they shouldn't have to.
    
    In addition, even for manifests that don't exceed 512MB the extremely
    large size of the single JSON object slows down its writing and reading
    every time, even if the metadata doesn't need to be accessed.
    
    An effective solution is to write the metadata of an artifact to a
    separate file. This PR introduces the ability for that into the Cloud
    Assembly schema, and updates the CLI to read from both sources if
    available.
    
    Removes an unused class from the refactoring project that we found
    through this project because it would have to be refactored. Rather than
    refactoring, bye-bye!
    
    Relates to aws/aws-cdk#34480.
    
    ---
    By submitting this pull request, I confirm that my contribution is made
    under the terms of the Apache-2.0 license
    
    ---------
    
    Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    rix0rrr and github-actions[bot] authored Feb 9, 2026
    Configuration menu
    Copy the full SHA
    48a22a1 View commit details
    Browse the repository at this point in the history
  2. fix(toolkit-lib): synth time is not measured accurately (#1121)

    In multiple places the `SYNTH` span doesn't measure the time to
    synthesize the assembly, but rather the time to select stacks from an
    already-synthesized assembly.
    
    Presumably this was done in order to avoid duplicating this line:
    
    ```ts
        const selectStacks = options.stacks ?? ALL_STACKS;
    ```
    
    Instead, introduce a helper function that gets called from all places,
    and centralize the `selectStacks` logic so we don't fear duplication
    anymore.
    
    ---
    By submitting this pull request, I confirm that my contribution is made
    under the terms of the Apache-2.0 license
    rix0rrr authored Feb 9, 2026
    Configuration menu
    Copy the full SHA
    da376fd View commit details
    Browse the repository at this point in the history

Commits on Feb 10, 2026

  1. fix: clean up temporary cdk-bootstrap directory after bootstrap (#1129

    )
    
    The bootstrap process creates a temporary directory using `fs.mkdtemp`
    to build the CloudFormation template before deploying it. However, this
    directory was never cleaned up after the deployment completed,
    regardless of whether it succeeded or failed.
    
    Over time, especially in CI/CD environments or on developer machines
    where bootstrap is run frequently, these orphaned directories accumulate
    in the system's temp folder. While each directory is small, the
    cumulative effect can waste disk space unnecessarily.
    
    This change wraps the deployment logic in a `try/finally` block to
    ensure the temporary directory is always removed after the bootstrap
    operation completes. Using `finally` guarantees cleanup happens even
    when the deployment throws an error, preventing resource leaks in all
    scenarios.
    
    ---
    By submitting this pull request, I confirm that my contribution is made
    under the terms of the Apache-2.0 license
    mrgrain authored Feb 10, 2026
    Configuration menu
    Copy the full SHA
    f388043 View commit details
    Browse the repository at this point in the history
  2. feat(deps): upgrade aws-cdk-lib (#1125)

    Upgrades project dependencies. See details in [workflow run].
    
    [Workflow Run]:
    https://github.com/aws/aws-cdk-cli/actions/runs/21846768152
    
    ------
    
    *Automatically created by projen via the "upgrade-aws-cdk-lib_aws-cdk"
    workflow*
    
    ---------
    
    Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    aws-cdk-automation and github-actions[bot] authored Feb 10, 2026
    Configuration menu
    Copy the full SHA
    750d9be View commit details
    Browse the repository at this point in the history
  3. fix(cli): glob patterns ignored in chokidar v4 (#1131)

    Fixes #1126.
    
    In CDK CLI v2.1103.0, we released #1059 which migrated our chokidar
    dependency from v3 to v4. We missed a breaking change in this migration:
    [glob is no longer
    supported](https://dev.to/43081j/migrating-from-chokidar-3x-to-4x-5ab5).
    This causes `cdk watch` in CDK CLI v2.1102.0 - v2.1105.0 to work
    improperly with `include` or `exclude` parameters that utilize globs --
    including the default configuration that is `include: ['**']`. Using the
    default `include` causes `cdk watch` to not watch any files at all.
    
    Since CDK CLI exposes an `include` and `exclude` property that users can
    set in their own `cdk.json` configuration, and we support globs, we must
    continue to do so. Therefore, this PR migrates globs into the new format
    that chokidar v4 understands - a `includes` path adn an `ignored`
    function.
    
    This code was written with the help of AI, including all tests, and also
    inspired by similar updates to other projects like this
    [one](https://github.com/11ty/eleventy/blob/deb6dbe62f95545aba80ff4d7bafe5e3d0b72f08/src/Util/GlobStripper.js).
    
    ---
    By submitting this pull request, I confirm that my contribution is made
    under the terms of the Apache-2.0 license
    kaizencc authored Feb 10, 2026
    Configuration menu
    Copy the full SHA
    4f58bf1 View commit details
    Browse the repository at this point in the history

Commits on Feb 11, 2026

  1. revert: glob patterns ignored in chokidar v4 (#1132)

    Reverts #1131
    
    There are additional glob patterns that the PR does not catch.
    
    ---
    
    By submitting this pull request, I confirm that my contribution is made
    under the terms of the Apache-2.0 license
    kaizencc authored Feb 11, 2026
    Configuration menu
    Copy the full SHA
    756d6c2 View commit details
    Browse the repository at this point in the history

Commits on Feb 12, 2026

  1. fix(cli): cdk watch glob pattern support broken after chokidar v3 -> …

    …v4 upgrade (#1134)
    
    Fixes #1126 
    
    ### Description
    The `cdk watch` command stopped working correctly after upgrading to CDK
    CLI v2.1100.1+. File changes were not being detected, causing watch mode
    to appear broken.
    
    ### Root Cause
    Chokidar v4 removed built-in glob pattern support. The CDK CLI was
    passing glob patterns like `**`, `**/*.ts` directly to
    `chokidar.watch()`, which no longer expands them. Instead, chokidar v4
    treats these as literal file paths.
    
    ### Solution
    Use `picomatch` library to handle glob pattern matching. The fix created
    a `createIgnoreMatcher` utility in toolkit-lib that:
    
    - Takes include/exclude glob patterns and `rootDir`
    - Returns an ignored function for chokidar that filters files based on
    patterns
    - Normalizes directory names to glob patterns (e.g., `my-dir` →
    `my-dir/**`) for backward compatibility
    - Updated watch implementations in both `toolkit-lib` and `aws-cdk`:
    - Changed `chokidar.watch(patterns, ...)` to `chokidar.watch('.', {
    ignored: fn, cwd: rootDir })`
    
    Fixed default include pattern in aws-cdk:
    - Changed from returning absolute rootDir path to `**` glob pattern
    - Chokidar reports relative paths, so absolute patterns never matched
    - API Compatibility
    
    
    This is a backwards-compatible change and there were no changes to the
    public API. Users continue to configure watch the same way in
    `cdk.json`:
    
    ```json
    {
      "watch": {
        "include": ["**/*.ts", "**/*.js"],
        "exclude": ["node_modules/**", "cdk.out/**"]
      }
    }
    ```
    
    ### Testing
    - Manual verification using the built `cdk` binary; verified that the
    currently released version does not work, then verified the new changes
    function as expected, and behave the same as versions before 2.1100.1
    (see logs)
    - Added unit tests for `createIgnoreMatcher` including pattern
    normalization
    - Added unit tests for chokidar configuration in `toolkit-lib`
    - Updated watch tests in `aws-cdk` to verify filtering behavior
    
    
    ### Logs
    Tested on MacOS. Initialized a new CDK app and ran `cdk watch` using CDK
    CLI v2.1100.0 (version before `cdk watch` stopped working). See
    annotated logs.
    
    #### Logs from `cdk watch` using CDK CLI v2.1100.0 (previously working
    version) in a sample project
    ```log
    $ cdk watch
    'watch' is observing directory '' for changes
    'watch' is observing directory 'bin' for changes
    'watch' is observing directory 'lib' for changes
    'watch' is observing the file 'bin/new-app.ts' for changes
    'watch' is observing the file 'lib/new-app-stack.ts' for changes
    Triggering initial 'cdk deploy'
    
    ✨  Synthesis time: 5.01s
    
    ⚠️ The --hotswap and --hotswap-fallback flags deliberately introduce CloudFormation drift to speed up deployments
    ⚠️ They should only be used for development - never use them for your production Stacks!
    
    NewAppStack: deploying... [1/1]
    
    ✨  hotswap-deployment time: 1.04s
    
    
     ✅  NewAppStack (no changes)
    
    ✨  Deployment time: 2.84s
    
    Stack ARN:
    arn:aws:cloudformation:us-east-1:229816860325:stack/NewAppStack/c76b2220-07b8-11f1-b773-0e04b5bd43cd
    
    ✨  Total time: 7.85s
    ```
    Here, I create a new file called `track-me-please`, to verify `watch`
    redeploys the app
    ```log
    Detected change to 'track-me-please' (type: add). Triggering 'cdk deploy'
    
    ✨  Synthesis time: 3.18s
    
    ⚠️ The --hotswap and --hotswap-fallback flags deliberately introduce CloudFormation drift to speed up deployments
    ⚠️ They should only be used for development - never use them for your production Stacks!
    
    NewAppStack: deploying... [1/1]
    
    ✨  hotswap-deployment time: 0.79s
    
    
     ✅  NewAppStack (no changes)
    
    ✨  Deployment time: 1.67s
    
    Stack ARN:
    arn:aws:cloudformation:us-east-1:229816860325:stack/NewAppStack/c76b2220-07b8-11f1-b773-0e04b5bd43cd
    
    ✨  Total time: 4.85s
    ```
    Here, I make a change to lib/new-app-stack.ts to verify `watch`
    redeploys the app
    ```log
    Detected change to 'lib/new-app-stack.ts' (type: change). Triggering 'cdk deploy'
    
    ✨  Synthesis time: 2.97s
    
    ⚠️ The --hotswap and --hotswap-fallback flags deliberately introduce CloudFormation drift to speed up deployments
    ⚠️ They should only be used for development - never use them for your production Stacks!
    
    NewAppStack: deploying... [1/1]
    
    ✨  hotswap-deployment time: 1.02s
    
    
     ✅  NewAppStack (no changes)
    
    ✨  Deployment time: 2.11s
    
    Stack ARN:
    arn:aws:cloudformation:us-east-1:229816860325:stack/NewAppStack/c76b2220-07b8-11f1-b773-0e04b5bd43cd
    
    ✨  Total time: 5.08s
    ```
    During this run, I also create a file called `.dont-track-me` and make a
    change to `test/new-app.test.ts`. Neither of these changes result in a
    deployment. This validates that these files are properly ignored.
    
    
    Then, I ran `cdk watch` using my locally built `cdk` (new changes). See
    annotated logs.
    
    #### Logs from `cdk watch` using locally built CDK CLI in a sample
    project
    
    Note that these logs immediately follow the logs above.
    
    ```log
    $ /Users/ianhou/workplace/aws-cdk-cli/packages/aws-cdk/bin/cdk watch
    'watch' is observing directory '' for changes
    'watch' is observing the file 'track-me-please' for changes
    'watch' is observing directory 'bin' for changes
    'watch' is observing directory 'lib' for changes
    'watch' is observing the file 'lib/new-app-stack.ts' for changes
    'watch' is observing the file 'bin/new-app.ts' for changes
    Triggering initial 'cdk deploy'
    
    ✨  Synthesis time: 4.29s
    
    ⚠️ The --hotswap and --hotswap-fallback flags deliberately introduce CloudFormation drift to speed up deployments
    ⚠️ They should only be used for development - never use them for your production Stacks!
    
    NewAppStack: deploying... [1/1]
    
    ✨  hotswap-deployment time: 0.8s
    
    
     ✅  NewAppStack (no changes)
    
    ✨  Deployment time: 2.72s
    
    Stack ARN:
    arn:aws:cloudformation:us-east-1:229816860325:stack/NewAppStack/c76b2220-07b8-11f1-b773-0e04b5bd43cd
    
    ✨  Total time: 7s
    ```
    Here, I create a new file called `track-me-too`. `watch` deploys, as
    expected.
    ```log
    Detected change to 'track-me-too' (type: add). Triggering 'cdk deploy'
    
    ✨  Synthesis time: 3.12s
    
    ⚠️ The --hotswap and --hotswap-fallback flags deliberately introduce CloudFormation drift to speed up deployments
    ⚠️ They should only be used for development - never use them for your production Stacks!
    
    NewAppStack: deploying... [1/1]
    
    ✨  hotswap-deployment time: 0.92s
    
    
     ✅  NewAppStack (no changes)
    
    ✨  Deployment time: 1.96s
    
    Stack ARN:
    arn:aws:cloudformation:us-east-1:229816860325:stack/NewAppStack/c76b2220-07b8-11f1-b773-0e04b5bd43cd
    
    ✨  Total time: 5.08s
    ```
    Here, I make a change to `lib/new-app-stack.ts`, which triggers a
    deployment, as expected.
    ```logs
    Detected change to 'lib/new-app-stack.ts' (type: change). Triggering 'cdk deploy'
    
    ✨  Synthesis time: 3.02s
    
    ⚠️ The --hotswap and --hotswap-fallback flags deliberately introduce CloudFormation drift to speed up deployments
    ⚠️ They should only be used for development - never use them for your production Stacks!
    
    NewAppStack: deploying... [1/1]
    
    ✨  hotswap-deployment time: 1.24s
    
    
     ✅  NewAppStack (no changes)
    
    ✨  Deployment time: 2.2s
    
    Stack ARN:
    arn:aws:cloudformation:us-east-1:229816860325:stack/NewAppStack/c76b2220-07b8-11f1-b773-0e04b5bd43cd
    
    ✨  Total time: 5.23s
    ```
    
    I also verified that the latest version of the CDK CLI does not track
    files correctly. Below are the logs, which show no activity, even though
    I made several file changes. The logs also do not indicate that `watch`
    is tracking any files.
    ```log
    $ cdk --version
    2.1105.0 (build 3e25a4e)
    
    $ cdk watch
    Triggering initial 'cdk deploy'
    
    ✨  Synthesis time: 3.94s
    
    ⚠️ The --hotswap and --hotswap-fallback flags deliberately introduce CloudFormation drift to speed up deployments
    ⚠️ They should only be used for development - never use them for your production Stacks!
    
    NewAppStack: deploying... [1/1]
    
    ✨  hotswap-deployment time: 1.18s
    
    
     ✅  NewAppStack (no changes)
    
    ✨  Deployment time: 3.23s
    
    Stack ARN:
    arn:aws:cloudformation:us-east-1:229816860325:stack/NewAppStack/c76b2220-07b8-11f1-b773-0e04b5bd43cd
    
    ✨  Total time: 7.17s
    ```
    
    
    
    ---
    By submitting this pull request, I confirm that my contribution is made
    under the terms of the Apache-2.0 license
    
    ---------
    
    Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    iankhou and github-actions[bot] authored Feb 12, 2026
    Configuration menu
    Copy the full SHA
    114788d View commit details
    Browse the repository at this point in the history
Loading