feat(aws-cdk): remove legacy exports#1250
Merged
aws-cdk-automation merged 1 commit intomainfrom Mar 24, 2026
Merged
Conversation
rix0rrr
approved these changes
Mar 24, 2026
a53a242 to
8bb71e5
Compare
8bb71e5 to
2d46fa3
Compare
The deprecated legacy exports have reached their end-of-life date of 2026-03-01. This removes all legacy compatibility shims, subpath export mappings, and the legacy namespace re-export. Unsanctioned subpath imports from the `aws-cdk` package are no longer available. Migrate to the official CDK Toolkit Library: https://docs.aws.amazon.com/cdk/api/toolkit-lib/
2d46fa3 to
18873b7
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1250 +/- ##
=======================================
Coverage 88.07% 88.07%
=======================================
Files 74 74
Lines 10351 10351
Branches 1383 1383
=======================================
Hits 9117 9117
Misses 1208 1208
Partials 26 26
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
1 task
1 task
github-merge-queue bot
pushed a commit
that referenced
this pull request
Mar 27, 2026
This was made possible by the migration in #1250, which moved all callers to use `deploymentMethod` directly. The `DeployStackOptions` interfaces in both `deploy-stack.ts` and `deployments.ts` still carried several deprecated properties that served as legacy compatibility shims, translating old-style options into the newer `deploymentMethod` parameter. Since all callers have been migrated to use `deploymentMethod` directly, these shims are no longer needed and the translation code was dead weight. This removes the deprecated `hotswap`, `hotswapPropertyOverrides`, `execute`, `changeSetName`, and `ignoreNoStacks` properties from the internal deployment interfaces, along with the compatibility translation logic in `Deployments.deployStack()` and `deployStack()`. The `CfnDeployOptions` interface in the CLI's `cdk-toolkit.ts` is cleaned up accordingly, no longer passing the removed options through to `Deployments`. Tests are updated to use `deploymentMethod` directly instead of the removed options. ### Checklist - [ ] This change contains a major version upgrade for a dependency and I confirm all breaking changes are addressed - Release notes for the new version: --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Relates to and resolves #310
In older versions of Node.js it was possible to import any file from any package. While the
aws-cdkpackage is a CLI and has essentially no public API, a number of internal symbols were being imported by downstream users from deep subpaths. When the package started declaring itsexportsfield in early 2025, a legacy compatibility layer was introduced (see aws/aws-cdk#33021) to avoid immediately breaking these consumers. Known subpath imports were mapped to alegacy-exports.tsshim that re-exported the symbols through the bundle, and a prominent runtime warning was added directing users to migrate to the official CDK Toolkit Library.The announced end-of-life date of 2026-03-01 has now passed and users have had over four months to migrate since the deprecation warnings started appearing in November 2025. This change completes the removal by deleting the entire legacy compatibility system: the
legacy-exports.tsentry point, thelib/legacy/directory with its copied and wrapped versions of old code (logging, configuration, aws-auth, types), thelegacynamespace re-export fromindex.ts, and all subpath export mappings inpackage.jsonthat pointed tolegacy-exports.js.This also eliminates a significant amount of dead code. The legacy logging module was a frozen copy from November 2024. The legacy configuration module duplicated the entire CLI argument parsing and settings loading logic. The legacy aws-auth module wrapped the current
SdkProviderwith an older interface. None of this code was used by the CLI itself.Users who still depend on these imports should migrate to the official CDK Toolkit Library which provides a stable, supported programmatic API. If a use case is not yet covered, please comment on #310.
aws-cdkpackage (e.g.aws-cdk/lib/api/aws-auth,aws-cdk/lib/logging,aws-cdk/lib/settings) are no longer available.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license