Skip to content

Commit 4ce64fe

Browse files
authored
fix(core): undeprecate addWarning (#26943)
Its deprecation is causing problems for `cdk-nag`, which has a use case for unsuppressible warnings. Undeprecate for now until we come up with a better all-round solution. Relates to #26914. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 57bcd9a commit 4ce64fe

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

packages/aws-cdk-lib/core/lib/annotations.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,16 @@ export class Annotations {
7373
}
7474

7575
/**
76-
* Adds a warning metadata entry to this construct.
76+
* Adds a warning metadata entry to this construct. Prefer using `addWarningV2`.
7777
*
7878
* The CLI will display the warning when an app is synthesized, or fail if run
79-
* in --strict mode.
79+
* in `--strict` mode.
80+
*
81+
* Warnings added by this call cannot be acknowledged. This will block users from
82+
* running in `--strict` mode until the deal with the warning, which makes it
83+
* effectively not very different from `addError`. Prefer using `addWarningV2` instead.
8084
*
8185
* @param message The warning message.
82-
* @deprecated - use addWarningV2 instead
8386
*/
8487
public addWarning(message: string) {
8588
this.addMessage(cxschema.ArtifactMetadataEntryType.WARN, message);

0 commit comments

Comments
 (0)