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

func AddError(message *string)
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

func AddInfo(message *string)
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

func AddWarning(message *string)
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

import "github.com/open-constructs/cdk-terrain-go/cdktn"

cdktn.Annotations_Of(scope IConstruct) Annotations
Returns the annotations API for a construct scope.

scopeRequired

  • Type: github.com/aws/constructs-go/constructs/v10.IConstruct
The scope.