Skip to content

Commit

Permalink
fix(core): undeprecate addWarning (#26943)
Browse files Browse the repository at this point in the history
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*
  • Loading branch information
rix0rrr authored and Mike Wrighton committed Sep 14, 2023
1 parent dd52f5f commit e4ea967
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/aws-cdk-lib/core/lib/annotations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,16 @@ export class Annotations {
}

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

0 comments on commit e4ea967

Please sign in to comment.