Skip to main content
Includes API for attaching annotations such as warning messages to constructs.

Methods

NameDescription
AddErrorAdds an { “error”: < message > } metadata entry to this construct.
AddInfoAdds an info metadata entry to this construct.
AddWarningAdds a warning metadata entry to this construct.

AddError

private void AddError(string Message)
Adds an { “error”: < message > } metadata entry to this construct. The toolkit will fail synthesis when errors are reported.

MessageRequired

  • Type: string
The error message.

AddInfo

private void AddInfo(string Message)
Adds an info metadata entry to this construct. The CLI will display the info message when apps are synthesized.

MessageRequired

  • Type: string
The info message.

AddWarning

private void AddWarning(string Message)
Adds a warning metadata entry to this construct. The CLI will display the warning when an app is synthesized. In a future release the CLI might introduce a —strict flag which will then fail the synthesis if it encounters a warning.

MessageRequired

  • Type: string
The warning message.

Static Functions

NameDescription
OfReturns the annotations API for a construct scope.

Of

using Io.Cdktn;

Annotations.Of(IConstruct Scope);
Returns the annotations API for a construct scope.

ScopeRequired

  • Type: Constructs.IConstruct
The scope.