iohost

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2026 License: Apache-2.0 Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package iohost defines how the toolkit talks to its caller: a Host that receives messages and answers requests.

Every toolkit action reports what it does as a stream of Message values sent to the Host's Notify method. A message has text that is safe to show a person, and most also carry a code, such as "CDK_TOOLKIT_I5502", and a payload in Data.

A few messages are requests, which ask the Host to decide something, such as whether to deploy a security-sensitive change. A Host answers through its Request method, and every request carries a default response the toolkit uses when the Host returns none.

This package is a Go port of the IoHost protocol in upstream's toolkit-lib. Its message codes are Code values generated from upstream's registry, such as ToolkitI5502, each with the Go type of its payload where it has been ported. Each variable documents its code's level, its description and its payload type, which makes the variables the registry: godoc lists them.

Writing a host

A host is any type with the two methods of Host, and a program picks the one that suits it:

A host keeps this contract with the toolkit:

  • It is safe for concurrent use. The toolkit may call Notify and Request from several goroutines at once, such as while it deploys stacks concurrently. Messages of one operation, which share a SpanID, arrive in the order they were sent, and nothing orders messages of different operations.
  • An error from Notify or Request fails the action that sent the message, and the action cleans up as it does for any failure.
  • Request answers with a value of the dynamic type of the request's Default, which is bool for a yes or no and string for a question, or with nil to accept the Default. An answer of another type fails the action.
  • Request returns once its context is done, because the toolkit acts on no answer after that. A host that waits for a person does so with the context.
  • The toolkit never closes or reconfigures the caller's host.
  • The messages an action sends while it cleans up after its context was cancelled carry a context that isn't cancelled, so that a host that fails messages once their context is done still receives them.

The toolkit sends every message, whatever its level, and it is the host's job to leave out the ones that aren't wanted: Level is the toolkit's recommendation of how much a message matters, and console.NonInteractive drops those below its own Level. Showing every message of LevelInfo and above is the usual choice.

Compatibility

Messages and requests are a part of the toolkit's public contract, on the same terms as upstream's:

  • Depend only on messages and requests that have a code. A message without one is informational, and may change or disappear without notice.
  • Only a message's Code and Data are covered. A payload changes only in type-compatible, additive ways: a field may be added, and information is never removed.
  • These changes are not breaking: a change to a message's text or level, to the default response of a request, to the order in which messages and requests are sent, the addition of new messages and requests, and the removal of a message that has no code.

This module's own versions follow Go's: while it is v0, a release makes no compatibility promise, and its notes say what changed.

Index

Examples

Constants

This section is empty.

Variables

View Source
var AssemblyE1002 = Code[any]{ID: "CDK_ASSEMBLY_E1002", Level: LevelError, Description: "Output lines emitted by the cloud assembly to stderr"}

AssemblyE1002 is CDK_ASSEMBLY_E1002: Output lines emitted by the cloud assembly to stderr

It is sent at error level. It has no payload.

View Source
var AssemblyE1111 = Code[ErrorPayload]{ID: "CDK_ASSEMBLY_E1111", Level: LevelError, Description: "Incompatible CDK CLI version. Upgrade needed."}

AssemblyE1111 is CDK_ASSEMBLY_E1111: Incompatible CDK CLI version. Upgrade needed.

It is sent at error level. Its payload is ErrorPayload.

View Source
var AssemblyE9999 = Code[any]{ID: "CDK_ASSEMBLY_E9999", Level: LevelError, Description: "Errors emitted by the cloud assembly"}

AssemblyE9999 is CDK_ASSEMBLY_E9999: Errors emitted by the cloud assembly

It is sent at error level. Its payload is upstream's cxapi.SynthesisMessage, which is not ported yet, so Data is untyped.

View Source
var AssemblyI0010 = Code[any]{ID: "CDK_ASSEMBLY_I0010", Level: LevelDebug, Description: "Generic environment preparation debug messages"}

AssemblyI0010 is CDK_ASSEMBLY_I0010: Generic environment preparation debug messages

It is sent at debug level. It has no payload.

View Source
var AssemblyI0042 = Code[UpdatedContext]{ID: "CDK_ASSEMBLY_I0042", Level: LevelDebug, Description: "Writing context updates"}

AssemblyI0042 is CDK_ASSEMBLY_I0042: Writing context updates

It is sent at debug level. Its payload is UpdatedContext.

View Source
var AssemblyI0150 = Code[any]{ID: "CDK_ASSEMBLY_I0150", Level: LevelDebug, Description: "Indicates the use of a pre-synthesized cloud assembly directory"}

AssemblyI0150 is CDK_ASSEMBLY_I0150: Indicates the use of a pre-synthesized cloud assembly directory

It is sent at debug level. It has no payload.

View Source
var AssemblyI0240 = Code[MissingContext]{ID: "CDK_ASSEMBLY_I0240", Level: LevelDebug, Description: "Context lookup was stopped as no further progress was made. "}

AssemblyI0240 is CDK_ASSEMBLY_I0240: Context lookup was stopped as no further progress was made.

It is sent at debug level. Its payload is MissingContext.

View Source
var AssemblyI0241 = Code[MissingContext]{ID: "CDK_ASSEMBLY_I0241", Level: LevelDebug, Description: "Fetching missing context. This is an iterative message that may appear multiple times with different missing keys."}

AssemblyI0241 is CDK_ASSEMBLY_I0241: Fetching missing context. This is an iterative message that may appear multiple times with different missing keys.

It is sent at debug level. Its payload is MissingContext.

View Source
var AssemblyI0300 = Code[ContextProviderMessageSource]{ID: "CDK_ASSEMBLY_I0300", Level: LevelInfo, Description: "An info message emitted by a Context Provider"}

AssemblyI0300 is CDK_ASSEMBLY_I0300: An info message emitted by a Context Provider

It is sent at info level. Its payload is ContextProviderMessageSource.

View Source
var AssemblyI0301 = Code[ContextProviderMessageSource]{ID: "CDK_ASSEMBLY_I0301", Level: LevelDebug, Description: "A debug message emitted by a Context Provider"}

AssemblyI0301 is CDK_ASSEMBLY_I0301: A debug message emitted by a Context Provider

It is sent at debug level. Its payload is ContextProviderMessageSource.

View Source
var AssemblyI1000 = Code[any]{ID: "CDK_ASSEMBLY_I1000", Level: LevelDebug, Description: "Cloud assembly output starts"}

AssemblyI1000 is CDK_ASSEMBLY_I1000: Cloud assembly output starts

It is sent at debug level. It has no payload.

View Source
var AssemblyI1001 = Code[any]{ID: "CDK_ASSEMBLY_I1001", Level: LevelInfo, Description: "Output lines emitted by the cloud assembly to stdout"}

AssemblyI1001 is CDK_ASSEMBLY_I1001: Output lines emitted by the cloud assembly to stdout

It is sent at info level. It has no payload.

View Source
var AssemblyI1003 = Code[any]{ID: "CDK_ASSEMBLY_I1003", Level: LevelInfo, Description: "Cloud assembly output finished"}

AssemblyI1003 is CDK_ASSEMBLY_I1003: Cloud assembly output finished

It is sent at info level. It has no payload.

View Source
var AssemblyI9999 = Code[any]{ID: "CDK_ASSEMBLY_I9999", Level: LevelInfo, Description: "Annotations emitted by the cloud assembly"}

AssemblyI9999 is CDK_ASSEMBLY_I9999: Annotations emitted by the cloud assembly

It is sent at info level. Its payload is upstream's cxapi.SynthesisMessage, which is not ported yet, so Data is untyped.

View Source
var AssemblyW0010 = Code[any]{ID: "CDK_ASSEMBLY_W0010", Level: LevelWarn, Description: "Emitted if the found framework version does not support context overflow"}

AssemblyW0010 is CDK_ASSEMBLY_W0010: Emitted if the found framework version does not support context overflow

It is sent at warn level. It has no payload.

View Source
var AssemblyW9999 = Code[any]{ID: "CDK_ASSEMBLY_W9999", Level: LevelWarn, Description: "Warnings emitted by the cloud assembly"}

AssemblyW9999 is CDK_ASSEMBLY_W9999: Warnings emitted by the cloud assembly

It is sent at warn level. Its payload is upstream's cxapi.SynthesisMessage, which is not ported yet, so Data is untyped.

View Source
var AssetsE5279 = Code[PublishAssetEvent]{ID: "CDK_ASSETS_E5279", Level: LevelError, Description: "There was an error while publishing the asset"}

AssetsE5279 is CDK_ASSETS_E5279: There was an error while publishing the asset

It is sent at error level. Its payload is PublishAssetEvent.

View Source
var AssetsI5270 = Code[PublishAssetEvent]{ID: "CDK_ASSETS_I5270", Level: LevelInfo, Description: "Publishing the asset has started"}

AssetsI5270 is CDK_ASSETS_I5270: Publishing the asset has started

It is sent at info level. Its payload is PublishAssetEvent.

View Source
var AssetsI5271 = Code[PublishAssetEvent]{ID: "CDK_ASSETS_I5271", Level: LevelDebug, Description: "Debug messaged emitted during publishing of the asset"}

AssetsI5271 is CDK_ASSETS_I5271: Debug messaged emitted during publishing of the asset

It is sent at debug level. Its payload is PublishAssetEvent.

View Source
var AssetsI5275 = Code[PublishAssetEvent]{ID: "CDK_ASSETS_I5275", Level: LevelInfo, Description: "Publishing the asset has completed successfully"}

AssetsI5275 is CDK_ASSETS_I5275: Publishing the asset has completed successfully

It is sent at info level. Its payload is PublishAssetEvent.

View Source
var SDKI0100 = Code[SDKTrace]{ID: "CDK_SDK_I0100", Level: LevelTrace, Description: "An SDK trace. SDK traces are emitted as traces to the IoHost, but contain the original SDK logging level."}

SDKI0100 is CDK_SDK_I0100: An SDK trace. SDK traces are emitted as traces to the IoHost, but contain the original SDK logging level.

It is sent at trace level. Its payload is SDKTrace.

View Source
var SDKI1100 = QuestionCode[MFATokenRequest]{ID: "CDK_SDK_I1100", Level: LevelInfo, Description: "Get an MFA token for an MFA device."}

SDKI1100 is CDK_SDK_I1100: Get an MFA token for an MFA device.

It is a request for a free-text answer, sent at info level. Its payload is MFATokenRequest.

View Source
var ToolkitE0101 = Code[any]{ID: "CDK_TOOLKIT_E0101", Level: LevelError, Description: "A notice that is marked as an error"}

ToolkitE0101 is CDK_TOOLKIT_E0101: A notice that is marked as an error

It is sent at error level. It has no payload.

View Source
var ToolkitE3900 = Code[ErrorPayload]{ID: "CDK_TOOLKIT_E3900", Level: LevelError, Description: "Resource import failed"}

ToolkitE3900 is CDK_TOOLKIT_E3900: Resource import failed

It is sent at error level. Its payload is ErrorPayload.

View Source
var ToolkitE5001 = Code[any]{ID: "CDK_TOOLKIT_E5001", Level: LevelError, Description: "No stacks found"}

ToolkitE5001 is CDK_TOOLKIT_E5001: No stacks found

It is sent at error level. It has no payload.

View Source
var ToolkitE5035 = Code[ErrorPayload]{ID: "CDK_TOOLKIT_E5035", Level: LevelError, Description: "A log monitoring error"}

ToolkitE5035 is CDK_TOOLKIT_E5035: A log monitoring error

It is sent at error level. Its payload is ErrorPayload.

View Source
var ToolkitE5500 = Code[ErrorPayload]{ID: "CDK_TOOLKIT_E5500", Level: LevelError, Description: "Stack Monitoring error"}

ToolkitE5500 is CDK_TOOLKIT_E5500: Stack Monitoring error

It is sent at error level. Its payload is ErrorPayload.

View Source
var ToolkitE6001 = Code[any]{ID: "CDK_TOOLKIT_E6001", Level: LevelError, Description: "No stacks found"}

ToolkitE6001 is CDK_TOOLKIT_E6001: No stacks found

It is sent at error level. It has no payload.

View Source
var ToolkitE6900 = Code[ErrorPayload]{ID: "CDK_TOOLKIT_E6900", Level: LevelError, Description: "Rollback failed"}

ToolkitE6900 is CDK_TOOLKIT_E6900: Rollback failed

It is sent at error level. Its payload is ErrorPayload.

View Source
var ToolkitE7010 = Code[any]{ID: "CDK_TOOLKIT_E7010", Level: LevelError, Description: "Action was aborted due to negative confirmation of request"}

ToolkitE7010 is CDK_TOOLKIT_E7010: Action was aborted due to negative confirmation of request

It is sent at error level. It has no payload.

View Source
var ToolkitE7900 = Code[ErrorPayload]{ID: "CDK_TOOLKIT_E7900", Level: LevelError, Description: "Stack deletion failed"}

ToolkitE7900 is CDK_TOOLKIT_E7900: Stack deletion failed

It is sent at error level. Its payload is ErrorPayload.

View Source
var ToolkitE8900 = Code[ErrorPayload]{ID: "CDK_TOOLKIT_E8900", Level: LevelError, Description: "Stack refactor failed"}

ToolkitE8900 is CDK_TOOLKIT_E8900: Stack refactor failed

It is sent at error level. Its payload is ErrorPayload.

View Source
var ToolkitE9500 = Code[DiagnosedStack]{ID: "CDK_TOOLKIT_E9500", Level: LevelError, Description: "Stack diagnosis (problems found)"}

ToolkitE9500 is CDK_TOOLKIT_E9500: Stack diagnosis (problems found)

It is sent at error level. Its payload is DiagnosedStack.

View Source
var ToolkitE9600 = Code[ValidateResult]{ID: "CDK_TOOLKIT_E9600", Level: LevelError, Description: "Policy validation failed"}

ToolkitE9600 is CDK_TOOLKIT_E9600: Policy validation failed

It is sent at error level. Its payload is ValidateResult.

View Source
var ToolkitE9900 = Code[ErrorPayload]{ID: "CDK_TOOLKIT_E9900", Level: LevelError, Description: "Bootstrap failed"}

ToolkitE9900 is CDK_TOOLKIT_E9900: Bootstrap failed

It is sent at error level. Its payload is ErrorPayload.

View Source
var ToolkitI0100 = Code[any]{ID: "CDK_TOOLKIT_I0100", Level: LevelInfo, Description: "Notices decoration (the header or footer of a list of notices)"}

ToolkitI0100 is CDK_TOOLKIT_I0100: Notices decoration (the header or footer of a list of notices)

It is sent at info level. It has no payload.

View Source
var ToolkitI0101 = Code[any]{ID: "CDK_TOOLKIT_I0101", Level: LevelInfo, Description: "A notice that is marked as informational"}

ToolkitI0101 is CDK_TOOLKIT_I0101: A notice that is marked as informational

It is sent at info level. It has no payload.

View Source
var ToolkitI1000 = Code[Operation]{ID: "CDK_TOOLKIT_I1000", Level: LevelInfo, Description: "Provides synthesis times."}

ToolkitI1000 is CDK_TOOLKIT_I1000: Provides synthesis times.

It is sent at info level. Its payload is Operation.

View Source
var ToolkitI1001 = Code[StackSelectionDetails]{ID: "CDK_TOOLKIT_I1001", Level: LevelTrace, Description: "Cloud Assembly synthesis is starting"}

ToolkitI1001 is CDK_TOOLKIT_I1001: Cloud Assembly synthesis is starting

It is sent at trace level. Its payload is StackSelectionDetails.

View Source
var ToolkitI1002 = Code[any]{ID: "CDK_TOOLKIT_I1002", Level: LevelInfo, Description: "Stacks added to the selection because they are dependencies of the selected stacks (upstream expansion)"}

ToolkitI1002 is CDK_TOOLKIT_I1002: Stacks added to the selection because they are dependencies of the selected stacks (upstream expansion)

It is sent at info level. It has no payload.

View Source
var ToolkitI1003 = Code[any]{ID: "CDK_TOOLKIT_I1003", Level: LevelInfo, Description: "Stacks added to the selection because they are dependent on the selected stacks (downstream expansion)"}

ToolkitI1003 is CDK_TOOLKIT_I1003: Stacks added to the selection because they are dependent on the selected stacks (downstream expansion)

It is sent at info level. It has no payload.

View Source
var ToolkitI1901 = Code[StackAndAssemblyData]{ID: "CDK_TOOLKIT_I1901", Level: LevelResult, Description: "Provides stack data"}

ToolkitI1901 is CDK_TOOLKIT_I1901: Provides stack data

It is sent at result level. Its payload is StackAndAssemblyData.

View Source
var ToolkitI1902 = Code[AssemblyData]{ID: "CDK_TOOLKIT_I1902", Level: LevelResult, Description: "Successfully deployed stacks"}

ToolkitI1902 is CDK_TOOLKIT_I1902: Successfully deployed stacks

It is sent at result level. Its payload is AssemblyData.

View Source
var ToolkitI2901 = Code[StackDetailsPayload]{ID: "CDK_TOOLKIT_I2901", Level: LevelResult, Description: "Provides details on the selected stacks and their dependencies"}

ToolkitI2901 is CDK_TOOLKIT_I2901: Provides details on the selected stacks and their dependencies

It is sent at result level. Its payload is StackDetailsPayload.

View Source
var ToolkitI3100 = ConfirmCode[any]{ID: "CDK_TOOLKIT_I3100", Level: LevelInfo, Description: "Confirm the import of a specific resource"}

ToolkitI3100 is CDK_TOOLKIT_I3100: Confirm the import of a specific resource

It is a yes/no request, sent at info level, which defaults to yes. Its payload is upstream's ResourceImportRequest, which is not ported yet, so Data is untyped.

View Source
var ToolkitI3110 = QuestionCode[any]{ID: "CDK_TOOLKIT_I3110", Level: LevelInfo, Description: "Additional information is needed to identify a resource"}

ToolkitI3110 is CDK_TOOLKIT_I3110: Additional information is needed to identify a resource

It is a request for a free-text answer, sent at info level. Its payload is upstream's ResourceIdentificationRequest, which is not ported yet, so Data is untyped.

View Source
var ToolkitI4000 = Code[StackSelectionDetails]{ID: "CDK_TOOLKIT_I4000", Level: LevelTrace, Description: "Diff stacks is starting"}

ToolkitI4000 is CDK_TOOLKIT_I4000: Diff stacks is starting

It is sent at trace level. Its payload is StackSelectionDetails.

View Source
var ToolkitI4001 = Code[DiffResult]{ID: "CDK_TOOLKIT_I4001", Level: LevelResult, Description: "Output of the diff command"}

ToolkitI4001 is CDK_TOOLKIT_I4001: Output of the diff command

It is sent at result level. Its payload is DiffResult.

View Source
var ToolkitI4002 = Code[StackDiff]{ID: "CDK_TOOLKIT_I4002", Level: LevelResult, Description: "The diff for a single stack"}

ToolkitI4002 is CDK_TOOLKIT_I4002: The diff for a single stack

It is sent at result level. Its payload is StackDiff.

View Source
var ToolkitI4500 = Code[StackSelectionDetails]{ID: "CDK_TOOLKIT_I4500", Level: LevelTrace, Description: "Drift detection is starting"}

ToolkitI4500 is CDK_TOOLKIT_I4500: Drift detection is starting

It is sent at trace level. Its payload is StackSelectionDetails.

View Source
var ToolkitI4590 = Code[DriftResultPayload]{ID: "CDK_TOOLKIT_I4590", Level: LevelResult, Description: "Results of a stack drift"}

ToolkitI4590 is CDK_TOOLKIT_I4590: Results of a stack drift

It is sent at result level. Its payload is DriftResultPayload.

View Source
var ToolkitI4592 = Code[SpanEnd]{ID: "CDK_TOOLKIT_I4592", Level: LevelResult, Description: "Results of the drift"}

ToolkitI4592 is CDK_TOOLKIT_I4592: Results of the drift

It is sent at result level. Its payload is SpanEnd. Upstream declares it as CDK_TOOLKIT_I4509 but sends CDK_TOOLKIT_I4592, which is the code hosts see.

View Source
var ToolkitI5000 = Code[SpanEnd]{ID: "CDK_TOOLKIT_I5000", Level: LevelInfo, Description: "Provides deployment times"}

ToolkitI5000 is CDK_TOOLKIT_I5000: Provides deployment times

It is sent at info level. Its payload is SpanEnd.

View Source
var ToolkitI5001 = Code[SpanEnd]{ID: "CDK_TOOLKIT_I5001", Level: LevelInfo, Description: "Provides total time in deploy action, including synth and rollback"}

ToolkitI5001 is CDK_TOOLKIT_I5001: Provides total time in deploy action, including synth and rollback

It is sent at info level. Its payload is SpanEnd.

View Source
var ToolkitI5002 = Code[SpanEnd]{ID: "CDK_TOOLKIT_I5002", Level: LevelInfo, Description: "Provides time for resource migration"}

ToolkitI5002 is CDK_TOOLKIT_I5002: Provides time for resource migration

It is sent at info level. Its payload is SpanEnd.

View Source
var ToolkitI5031 = Code[any]{ID: "CDK_TOOLKIT_I5031", Level: LevelInfo, Description: "Informs about any log groups that are traced as part of the deployment"}

ToolkitI5031 is CDK_TOOLKIT_I5031: Informs about any log groups that are traced as part of the deployment

It is sent at info level. It has no payload.

View Source
var ToolkitI5032 = Code[CloudWatchLogMonitorControlEvent]{ID: "CDK_TOOLKIT_I5032", Level: LevelDebug, Description: "Start monitoring log groups"}

ToolkitI5032 is CDK_TOOLKIT_I5032: Start monitoring log groups

It is sent at debug level. Its payload is CloudWatchLogMonitorControlEvent.

View Source
var ToolkitI5033 = Code[CloudWatchLogEvent]{ID: "CDK_TOOLKIT_I5033", Level: LevelInfo, Description: "A log event received from Cloud Watch"}

ToolkitI5033 is CDK_TOOLKIT_I5033: A log event received from Cloud Watch

It is sent at info level. Its payload is CloudWatchLogEvent.

View Source
var ToolkitI5034 = Code[CloudWatchLogMonitorControlEvent]{ID: "CDK_TOOLKIT_I5034", Level: LevelDebug, Description: "Stop monitoring log groups"}

ToolkitI5034 is CDK_TOOLKIT_I5034: Stop monitoring log groups

It is sent at debug level. Its payload is CloudWatchLogMonitorControlEvent.

View Source
var ToolkitI5050 = ConfirmCode[ConfirmationRequest]{ID: "CDK_TOOLKIT_I5050", Level: LevelInfo, Description: "Confirm rollback during deployment"}

ToolkitI5050 is CDK_TOOLKIT_I5050: Confirm rollback during deployment

It is a yes/no request, sent at info level, which defaults to yes. Its payload is ConfirmationRequest.

View Source
var ToolkitI5060 = ConfirmCode[DeployConfirmationRequest]{ID: "CDK_TOOLKIT_I5060", Level: LevelInfo, Description: "Confirm deploy security sensitive changes"}

ToolkitI5060 is CDK_TOOLKIT_I5060: Confirm deploy security sensitive changes

It is a yes/no request, sent at info level, which defaults to yes. Its payload is DeployConfirmationRequest.

View Source
var ToolkitI5100 = Code[StackDeployProgress]{ID: "CDK_TOOLKIT_I5100", Level: LevelInfo, Description: "Stack deploy progress"}

ToolkitI5100 is CDK_TOOLKIT_I5100: Stack deploy progress

It is sent at info level. Its payload is StackDeployProgress.

View Source
var ToolkitI5210 = Code[BuildAsset]{ID: "CDK_TOOLKIT_I5210", Level: LevelTrace, Description: "Started building a specific asset"}

ToolkitI5210 is CDK_TOOLKIT_I5210: Started building a specific asset

It is sent at trace level. Its payload is BuildAsset.

View Source
var ToolkitI5211 = Code[SpanEnd]{ID: "CDK_TOOLKIT_I5211", Level: LevelTrace, Description: "Building the asset has completed"}

ToolkitI5211 is CDK_TOOLKIT_I5211: Building the asset has completed

It is sent at trace level. Its payload is SpanEnd.

View Source
var ToolkitI5220 = Code[PublishAsset]{ID: "CDK_TOOLKIT_I5220", Level: LevelTrace, Description: "Started publishing a specific asset"}

ToolkitI5220 is CDK_TOOLKIT_I5220: Started publishing a specific asset

It is sent at trace level. Its payload is PublishAsset.

View Source
var ToolkitI5221 = Code[SpanEnd]{ID: "CDK_TOOLKIT_I5221", Level: LevelTrace, Description: "Publishing the asset has completed"}

ToolkitI5221 is CDK_TOOLKIT_I5221: Publishing the asset has completed

It is sent at trace level. Its payload is SpanEnd.

View Source
var ToolkitI5310 = Code[any]{ID: "CDK_TOOLKIT_I5310", Level: LevelDebug, Description: "The computed settings used for file watching"}

ToolkitI5310 is CDK_TOOLKIT_I5310: The computed settings used for file watching

It is sent at debug level. Its payload is upstream's WatchSettings, which is not ported yet, so Data is untyped.

View Source
var ToolkitI5311 = Code[any]{ID: "CDK_TOOLKIT_I5311", Level: LevelInfo, Description: "File watching started"}

ToolkitI5311 is CDK_TOOLKIT_I5311: File watching started

It is sent at info level. Its payload is upstream's FileWatchEvent, which is not ported yet, so Data is untyped.

View Source
var ToolkitI5312 = Code[any]{ID: "CDK_TOOLKIT_I5312", Level: LevelInfo, Description: "File event detected, starting deployment"}

ToolkitI5312 is CDK_TOOLKIT_I5312: File event detected, starting deployment

It is sent at info level. Its payload is upstream's FileWatchEvent, which is not ported yet, so Data is untyped.

View Source
var ToolkitI5313 = Code[any]{ID: "CDK_TOOLKIT_I5313", Level: LevelInfo, Description: "File event detected during active deployment, changes are queued"}

ToolkitI5313 is CDK_TOOLKIT_I5313: File event detected during active deployment, changes are queued

It is sent at info level. Its payload is upstream's FileWatchEvent, which is not ported yet, so Data is untyped.

View Source
var ToolkitI5314 = Code[any]{ID: "CDK_TOOLKIT_I5314", Level: LevelInfo, Description: "Initial watch deployment started"}

ToolkitI5314 is CDK_TOOLKIT_I5314: Initial watch deployment started

It is sent at info level. It has no payload.

View Source
var ToolkitI5315 = Code[any]{ID: "CDK_TOOLKIT_I5315", Level: LevelInfo, Description: "Queued watch deployment started"}

ToolkitI5315 is CDK_TOOLKIT_I5315: Queued watch deployment started

It is sent at info level. It has no payload.

View Source
var ToolkitI5400 = Code[HotswapDeploymentAttempt]{ID: "CDK_TOOLKIT_I5400", Level: LevelTrace, Description: "Attempting a hotswap deployment"}

ToolkitI5400 is CDK_TOOLKIT_I5400: Attempting a hotswap deployment

It is sent at trace level. Its payload is HotswapDeploymentAttempt.

View Source
var ToolkitI5401 = Code[HotswapDeploymentDetails]{ID: "CDK_TOOLKIT_I5401", Level: LevelTrace, Description: "Computed details for the hotswap deployment"}

ToolkitI5401 is CDK_TOOLKIT_I5401: Computed details for the hotswap deployment

It is sent at trace level. Its payload is HotswapDeploymentDetails.

View Source
var ToolkitI5402 = Code[HotswappableChange]{ID: "CDK_TOOLKIT_I5402", Level: LevelInfo, Description: "A hotswappable change is processed as part of a hotswap deployment"}

ToolkitI5402 is CDK_TOOLKIT_I5402: A hotswappable change is processed as part of a hotswap deployment

It is sent at info level. Its payload is HotswappableChange.

View Source
var ToolkitI5403 = Code[HotswappableChange]{ID: "CDK_TOOLKIT_I5403", Level: LevelInfo, Description: "The hotswappable change has completed processing"}

ToolkitI5403 is CDK_TOOLKIT_I5403: The hotswappable change has completed processing

It is sent at info level. Its payload is HotswappableChange.

View Source
var ToolkitI5410 = Code[HotswapResult]{ID: "CDK_TOOLKIT_I5410", Level: LevelInfo, Description: "Hotswap deployment has ended, a full deployment might still follow if needed"}

ToolkitI5410 is CDK_TOOLKIT_I5410: Hotswap deployment has ended, a full deployment might still follow if needed

It is sent at info level. Its payload is HotswapResult.

View Source
var ToolkitI5501 = Code[StackMonitoringControlEvent]{ID: "CDK_TOOLKIT_I5501", Level: LevelInfo, Description: "Stack Monitoring: Start monitoring of a single stack"}

ToolkitI5501 is CDK_TOOLKIT_I5501: Stack Monitoring: Start monitoring of a single stack

It is sent at info level. Its payload is StackMonitoringControlEvent.

View Source
var ToolkitI5502 = Code[StackActivity]{ID: "CDK_TOOLKIT_I5502", Level: LevelInfo, Description: "Stack Monitoring: Activity event for a single stack"}

ToolkitI5502 is CDK_TOOLKIT_I5502: Stack Monitoring: Activity event for a single stack

It is sent at info level. Its payload is StackActivity.

View Source
var ToolkitI5503 = Code[StackMonitoringControlEvent]{ID: "CDK_TOOLKIT_I5503", Level: LevelInfo, Description: "Stack Monitoring: Finished monitoring of a single stack"}

ToolkitI5503 is CDK_TOOLKIT_I5503: Stack Monitoring: Finished monitoring of a single stack

It is sent at info level. Its payload is StackMonitoringControlEvent.

View Source
var ToolkitI5900 = Code[DeployStackResult]{ID: "CDK_TOOLKIT_I5900", Level: LevelResult, Description: "Deployment results on success"}

ToolkitI5900 is CDK_TOOLKIT_I5900: Deployment results on success

It is sent at result level. Its payload is DeployStackResult.

View Source
var ToolkitI5901 = Code[any]{ID: "CDK_TOOLKIT_I5901", Level: LevelInfo, Description: "Generic deployment success messages"}

ToolkitI5901 is CDK_TOOLKIT_I5901: Generic deployment success messages

It is sent at info level. It has no payload.

View Source
var ToolkitI6000 = Code[SpanEnd]{ID: "CDK_TOOLKIT_I6000", Level: LevelInfo, Description: "Provides rollback times"}

ToolkitI6000 is CDK_TOOLKIT_I6000: Provides rollback times

It is sent at info level. Its payload is SpanEnd.

View Source
var ToolkitI6100 = Code[StackRollbackProgress]{ID: "CDK_TOOLKIT_I6100", Level: LevelInfo, Description: "Stack rollback progress"}

ToolkitI6100 is CDK_TOOLKIT_I6100: Stack rollback progress

It is sent at info level. Its payload is StackRollbackProgress.

View Source
var ToolkitI7000 = Code[SpanEnd]{ID: "CDK_TOOLKIT_I7000", Level: LevelInfo, Description: "Provides destroy times"}

ToolkitI7000 is CDK_TOOLKIT_I7000: Provides destroy times

It is sent at info level. Its payload is SpanEnd.

View Source
var ToolkitI7001 = Code[SpanEnd]{ID: "CDK_TOOLKIT_I7001", Level: LevelTrace, Description: "Provides destroy time for a single stack"}

ToolkitI7001 is CDK_TOOLKIT_I7001: Provides destroy time for a single stack

It is sent at trace level. Its payload is SpanEnd.

View Source
var ToolkitI7010 = ConfirmCode[ConfirmationRequest]{ID: "CDK_TOOLKIT_I7010", Level: LevelInfo, Description: "Confirm destroy stacks"}

ToolkitI7010 is CDK_TOOLKIT_I7010: Confirm destroy stacks

It is a yes/no request, sent at info level, which defaults to yes. Its payload is ConfirmationRequest.

View Source
var ToolkitI7100 = Code[StackDestroyProgress]{ID: "CDK_TOOLKIT_I7100", Level: LevelInfo, Description: "Stack destroy progress"}

ToolkitI7100 is CDK_TOOLKIT_I7100: Stack destroy progress

It is sent at info level. Its payload is StackDestroyProgress.

View Source
var ToolkitI7101 = Code[StackDestroy]{ID: "CDK_TOOLKIT_I7101", Level: LevelTrace, Description: "Start stack destroying"}

ToolkitI7101 is CDK_TOOLKIT_I7101: Start stack destroying

It is sent at trace level. Its payload is StackDestroy.

View Source
var ToolkitI7900 = Code[StackArtifact]{ID: "CDK_TOOLKIT_I7900", Level: LevelResult, Description: "Stack deletion succeeded"}

ToolkitI7900 is CDK_TOOLKIT_I7900: Stack deletion succeeded

It is sent at result level. Its payload is StackArtifact.

View Source
var ToolkitI8810 = ConfirmCode[ConfirmationRequest]{ID: "CDK_TOOLKIT_I8810", Level: LevelInfo, Description: "Confirm orphan resources"}

ToolkitI8810 is CDK_TOOLKIT_I8810: Confirm orphan resources

It is a yes/no request, sent at info level, which defaults to yes. Its payload is ConfirmationRequest.

View Source
var ToolkitI8900 = Code[any]{ID: "CDK_TOOLKIT_I8900", Level: LevelResult, Description: "Refactor result"}

ToolkitI8900 is CDK_TOOLKIT_I8900: Refactor result

It is sent at result level. Its payload is upstream's RefactorResult, which is not ported yet, so Data is untyped.

View Source
var ToolkitI8910 = ConfirmCode[ConfirmationRequest]{ID: "CDK_TOOLKIT_I8910", Level: LevelInfo, Description: "Confirm refactor"}

ToolkitI8910 is CDK_TOOLKIT_I8910: Confirm refactor

It is a yes/no request, sent at info level, which defaults to yes. Its payload is ConfirmationRequest.

View Source
var ToolkitI9000 = Code[SpanEnd]{ID: "CDK_TOOLKIT_I9000", Level: LevelInfo, Description: "Provides bootstrap times"}

ToolkitI9000 is CDK_TOOLKIT_I9000: Provides bootstrap times

It is sent at info level. Its payload is SpanEnd.

View Source
var ToolkitI9100 = Code[BootstrapEnvironmentProgress]{ID: "CDK_TOOLKIT_I9100", Level: LevelInfo, Description: "Bootstrap progress"}

ToolkitI9100 is CDK_TOOLKIT_I9100: Bootstrap progress

It is sent at info level. Its payload is BootstrapEnvironmentProgress.

View Source
var ToolkitI9210 = QuestionCode[any]{ID: "CDK_TOOLKIT_I9210", Level: LevelInfo, Description: "Confirm the deletion of a batch of assets"}

ToolkitI9210 is CDK_TOOLKIT_I9210: Confirm the deletion of a batch of assets

It is a request for a free-text answer, sent at info level. Its payload is upstream's AssetBatchDeletionRequest, which is not ported yet, so Data is untyped.

View Source
var ToolkitI9300 = Code[any]{ID: "CDK_TOOLKIT_I9300", Level: LevelInfo, Description: "Confirm the feature flag configuration changes"}

ToolkitI9300 is CDK_TOOLKIT_I9300: Confirm the feature flag configuration changes

It is sent at info level. Its payload is upstream's FeatureFlagChangeRequest, which is not ported yet, so Data is untyped.

View Source
var ToolkitI9400 = Code[any]{ID: "CDK_TOOLKIT_I9400", Level: LevelInfo, Description: "All assets are already published"}

ToolkitI9400 is CDK_TOOLKIT_I9400: All assets are already published

It is sent at info level. It has no payload.

View Source
var ToolkitI9401 = Code[AssetsPayload]{ID: "CDK_TOOLKIT_I9401", Level: LevelInfo, Description: "Publishing assets"}

ToolkitI9401 is CDK_TOOLKIT_I9401: Publishing assets

It is sent at info level. Its payload is AssetsPayload.

View Source
var ToolkitI9402 = Code[AssetsPayload]{ID: "CDK_TOOLKIT_I9402", Level: LevelResult, Description: "Publish assets results on success"}

ToolkitI9402 is CDK_TOOLKIT_I9402: Publish assets results on success

It is sent at result level. Its payload is AssetsPayload.

View Source
var ToolkitI9500 = Code[DiagnosedStack]{ID: "CDK_TOOLKIT_I9500", Level: LevelInfo, Description: "Stack diagnosis (no problems found)"}

ToolkitI9500 is CDK_TOOLKIT_I9500: Stack diagnosis (no problems found)

It is sent at info level. Its payload is DiagnosedStack.

View Source
var ToolkitI9600 = Code[ValidateResult]{ID: "CDK_TOOLKIT_I9600", Level: LevelInfo, Description: "Validation did not find any problems"}

ToolkitI9600 is CDK_TOOLKIT_I9600: Validation did not find any problems

It is sent at info level. Its payload is ValidateResult.

View Source
var ToolkitI9601 = Code[any]{ID: "CDK_TOOLKIT_I9601", Level: LevelInfo, Description: "No policy validation report found"}

ToolkitI9601 is CDK_TOOLKIT_I9601: No policy validation report found

It is sent at info level. It has no payload.

View Source
var ToolkitI9900 = Code[EnvironmentPayload]{ID: "CDK_TOOLKIT_I9900", Level: LevelResult, Description: "Bootstrap results on success"}

ToolkitI9900 is CDK_TOOLKIT_I9900: Bootstrap results on success

It is sent at result level. Its payload is EnvironmentPayload.

View Source
var ToolkitW0100 = Code[any]{ID: "CDK_TOOLKIT_W0100", Level: LevelWarn, Description: "Credential plugin warnings"}

ToolkitW0100 is CDK_TOOLKIT_W0100: Credential plugin warnings

It is sent at warn level. It has no payload.

View Source
var ToolkitW0101 = Code[any]{ID: "CDK_TOOLKIT_W0101", Level: LevelWarn, Description: "A notice that is marked as a warning"}

ToolkitW0101 is CDK_TOOLKIT_W0101: A notice that is marked as a warning

It is sent at warn level. It has no payload.

View Source
var ToolkitW4591 = Code[SingleStack]{ID: "CDK_TOOLKIT_W4591", Level: LevelWarn, Description: "Missing drift result fort a stack."}

ToolkitW4591 is CDK_TOOLKIT_W4591: Missing drift result fort a stack.

It is sent at warn level. Its payload is SingleStack.

View Source
var ToolkitW5021 = Code[any]{ID: "CDK_TOOLKIT_W5021", Level: LevelWarn, Description: "Empty non-existent stack, deployment is skipped"}

ToolkitW5021 is CDK_TOOLKIT_W5021: Empty non-existent stack, deployment is skipped

It is sent at warn level. It has no payload.

View Source
var ToolkitW5022 = Code[any]{ID: "CDK_TOOLKIT_W5022", Level: LevelWarn, Description: "Empty existing stack, stack will be destroyed"}

ToolkitW5022 is CDK_TOOLKIT_W5022: Empty existing stack, stack will be destroyed

It is sent at warn level. It has no payload.

View Source
var ToolkitW5400 = Code[any]{ID: "CDK_TOOLKIT_W5400", Level: LevelWarn, Description: "Hotswap disclosure message"}

ToolkitW5400 is CDK_TOOLKIT_W5400: Hotswap disclosure message

It is sent at warn level. It has no payload.

View Source
var ToolkitW5500 = Code[ErrorPayload]{ID: "CDK_TOOLKIT_W5500", Level: LevelWarn, Description: "Stack events could not be read; the reported event log may be incomplete"}

ToolkitW5500 is CDK_TOOLKIT_W5500: Stack events could not be read; the reported event log may be incomplete

It is sent at warn level. Its payload is ErrorPayload.

View Source
var ToolkitW5902 = Code[any]{ID: "CDK_TOOLKIT_W5902", Level: LevelWarn, Description: "Express Mode deployment completed with resources still stabilizing"}

ToolkitW5902 is CDK_TOOLKIT_W5902: Express Mode deployment completed with resources still stabilizing

It is sent at warn level. It has no payload.

View Source
var ToolkitW7010 = Code[any]{ID: "CDK_TOOLKIT_W7010", Level: LevelWarn, Description: "A provided stack name does not match any stack"}

ToolkitW7010 is CDK_TOOLKIT_W7010: A provided stack name does not match any stack

It is sent at warn level. It has no payload.

View Source
var ToolkitW7011 = Code[any]{ID: "CDK_TOOLKIT_W7011", Level: LevelWarn, Description: "No stacks match the provided names, nothing to destroy"}

ToolkitW7011 is CDK_TOOLKIT_W7011: No stacks match the provided names, nothing to destroy

It is sent at warn level. It has no payload.

View Source
var ToolkitW7902 = Code[any]{ID: "CDK_TOOLKIT_W7902", Level: LevelWarn, Description: "Express Mode deletion completed with resources still tearing down"}

ToolkitW7902 is CDK_TOOLKIT_W7902: Express Mode deletion completed with resources still tearing down

It is sent at warn level. It has no payload.

View Source
var ToolkitW8010 = Code[any]{ID: "CDK_TOOLKIT_W8010", Level: LevelWarn, Description: "Refactor execution not yet supported"}

ToolkitW8010 is CDK_TOOLKIT_W8010: Refactor execution not yet supported

It is sent at warn level. It has no payload.

View Source
var ToolkitW9501 = Code[DiagnosedStack]{ID: "CDK_TOOLKIT_W9501", Level: LevelWarn, Description: "Stack diagnosis (diagnosis could not be performed)"}

ToolkitW9501 is CDK_TOOLKIT_W9501: Stack diagnosis (diagnosis could not be performed)

It is sent at warn level. Its payload is DiagnosedStack.

View Source
var ToolkitW9602 = Code[any]{ID: "CDK_TOOLKIT_W9602", Level: LevelWarn, Description: "Online validation could not be completed for a stack"}

ToolkitW9602 is CDK_TOOLKIT_W9602: Online validation could not be completed for a stack

It is sent at warn level. It has no payload.

View Source
var ToolkitW9902 = Code[any]{ID: "CDK_TOOLKIT_W9902", Level: LevelWarn, Description: "Bootstrap completed with Express Mode, resources still stabilizing"}

ToolkitW9902 is CDK_TOOLKIT_W9902: Bootstrap completed with Express Mode, resources still stabilizing

It is sent at warn level. It has no payload.

Functions

func NeedsApproval

func NeedsApproval(policy RequireApproval, req Request) bool

NeedsApproval reports whether a host must put req to a person under policy, rather than answer yes itself: the CDK CLI's rule, its skipApprovalStep inverted.

Only CDK_TOOLKIT_I5060 can be approved without asking: under RequireApprovalNever always; under RequireApprovalBroadening when its PermissionChangeType is none or non-broadening; and under RequireApprovalDestructive when it has no DestructiveChanges. Every other request needs approval, as does CDK_TOOLKIT_I5060 under RequireApprovalAnyChange or a policy that isn't one of the four. A CDK_TOOLKIT_I5060 whose payload isn't a DeployConfirmationRequest has no permission change and no destructive changes, as upstream reads a missing one, so it needs approval under RequireApprovalBroadening and not under RequireApprovalDestructive.

Types

type Action

type Action string

Action is the toolkit action a message comes from. The values are upstream's action names.

const (
	ActionAssembly      Action = "assembly"
	ActionBootstrap     Action = "bootstrap"
	ActionSynth         Action = "synth"
	ActionList          Action = "list"
	ActionDiff          Action = "diff"
	ActionDeploy        Action = "deploy"
	ActionDrift         Action = "drift"
	ActionRollback      Action = "rollback"
	ActionPublishAssets Action = "publish-assets"
	ActionWatch         Action = "watch"
	ActionDestroy       Action = "destroy"
	ActionDoctor        Action = "doctor"
	ActionGC            Action = "gc"
	ActionImport        Action = "import"
	ActionMetadata      Action = "metadata"
	ActionInit          Action = "init"
	ActionMigrate       Action = "migrate"
	ActionRefactor      Action = "refactor"
	ActionDiagnose      Action = "diagnose"
	ActionOrphan        Action = "orphan"
	ActionFlags         Action = "flags"
	ActionValidate      Action = "validate"

	// ActionNotices is the action of the messages toolkit.Notices sends; upstream forces it onto its notices' messages, though it isn't one of upstream's toolkit actions.
	ActionNotices Action = "notices"
)

type AffectedResource

type AffectedResource struct {
	// LogicalID is the resource's logical ID.
	LogicalID string

	// ResourceType is the resource's CloudFormation type.
	ResourceType string

	// Description describes the resource for people; empty means none, so that messages name it by its type and physical name.
	Description string

	// PhysicalName is the resource's name as deployed, or empty when it isn't known.
	PhysicalName string

	// Metadata is the metadata of the construct that defines the resource, or nil when the cloud assembly has none for it.
	Metadata *cloudassembly.ResourceMetadata
}

AffectedResource is a resource a hotswap updates: upstream's AffectedResource.

type AssemblyData

type AssemblyData struct {
	// AssemblyDirectory is the cloud assembly's directory.
	AssemblyDirectory string

	// StacksCount is the number of stacks selected.
	StacksCount int

	// StackIDs are the hierarchical IDs of the stacks selected.
	StackIDs []string
}

AssemblyData is the payload of the message that reports a synthesis that selected several stacks (CDK_TOOLKIT_I1902).

type AssetEventType

type AssetEventType string

AssetEventType is the kind of a PublishAssetEvent: upstream's cdk-assets EventType, with its strings.

const (
	// AssetEventStart is sent when building or publishing an asset starts (CDK_ASSETS_I5270).
	AssetEventStart AssetEventType = "start"

	// AssetEventSuccess is sent when building or publishing an asset succeeds (CDK_ASSETS_I5275).
	AssetEventSuccess AssetEventType = "success"

	// AssetEventFail is sent when building or publishing an asset fails (CDK_ASSETS_E5279).
	AssetEventFail AssetEventType = "fail"

	// The rest are details, sent as CDK_ASSETS_I5271.
	AssetEventCheck     AssetEventType = "check"      // checking whether the asset is published already
	AssetEventFound     AssetEventType = "found"      // the asset is published already
	AssetEventCached    AssetEventType = "cached"     // the asset is packaged already, from an earlier run
	AssetEventBuild     AssetEventType = "build"      // the asset is being packaged
	AssetEventUpload    AssetEventType = "upload"     // the asset is being uploaded
	AssetEventDebug     AssetEventType = "debug"      // any other detail
	AssetEventShellOpen AssetEventType = "shell_open" // a command the asset is built with starts

	// AssetEventShellStdout and AssetEventShellStderr carry a line of a command's output, sent as CDK_ASSETS_I5271, where upstream drops them (Epic H's EH-2).
	AssetEventShellStdout AssetEventType = "shell_stdout"
	AssetEventShellStderr AssetEventType = "shell_stderr"

	// AssetEventShellClose is a command ending, which is never sent, as upstream drops it.
	AssetEventShellClose AssetEventType = "shell_close"
)

The asset event types.

type AssetsPayload

type AssetsPayload struct {
	// Assets are the assets, one entry per asset and destination, in the order the work graph has them.
	Assets []cloudassembly.AssetEntry
}

AssetsPayload is the payload of the messages that start and report publishing assets (CDK_TOOLKIT_I9401 and CDK_TOOLKIT_I9402): upstream's AssetsPayload.

type BootstrapEnvironmentProgress

type BootstrapEnvironmentProgress struct {
	// Total is the number of environments being bootstrapped, and Current this one's place among them, from 1.
	Total   int
	Current int

	// Environment is the environment being bootstrapped.
	Environment cloudassembly.Environment
}

BootstrapEnvironmentProgress is the payload of the message that starts bootstrapping one environment (CDK_TOOLKIT_I9100).

type BuildAsset

type BuildAsset struct {
	// Asset is the asset being built, with the destination of the entry that asked for the build.
	Asset cloudassembly.AssetEntry
}

BuildAsset is the payload of the message that starts building one asset (CDK_TOOLKIT_I5210): upstream's BuildAsset.

type CloudWatchLogEvent

type CloudWatchLogEvent struct {
	// Message is the event's message, as CloudWatch Logs returns it.
	Message string

	// LogGroupName is the name of the log group the event belongs to.
	LogGroupName string

	// Timestamp is when the event occurred.
	Timestamp time.Time
}

CloudWatchLogEvent is the payload of a message reporting one CloudWatch Logs event (CDK_TOOLKIT_I5033).

type CloudWatchLogMonitorControlEvent

type CloudWatchLogMonitorControlEvent struct {
	// Monitor identifies the monitor, so that a host can tell apart the events of monitors that run at once.
	// It is empty when a monitor that was not running is stopped.
	Monitor string

	// LogGroupNames are the names of the log groups monitored.
	LogGroupNames []string
}

CloudWatchLogMonitorControlEvent is the payload of the messages that start and stop the monitoring of CloudWatch Logs log groups (CDK_TOOLKIT_I5032 and CDK_TOOLKIT_I5034).

type Code

type Code[T any] struct {
	// ID is the code as it appears in [Message.Code], such as "CDK_TOOLKIT_I5502".
	ID string

	// Level is the level messages with this code are sent at.
	Level Level

	// Description is upstream's description of the code.
	Description string
}

Code is a kind of message, with its payload type T. The toolkit's codes are the package-level variables generated from upstream's registry, such as ToolkitI5502.

Match a message with Is and read its payload with Data:

if activity, ok := iohost.ToolkitI5502.Data(msg); ok {
	// use activity
}

A code whose payload has not been ported yet has T = any, and a code without a payload is also a Code[any] whose messages have nil Data; each code's documentation says which.

func (Code[T]) Data

func (c Code[T]) Data(msg Message) (T, bool)

Data returns msg's payload, and whether msg has this code and a payload of type T.

func (Code[T]) Is

func (c Code[T]) Is(msg Message) bool

Is reports whether msg has this code.

func (Code[T]) Msg

func (c Code[T]) Msg(text string, payload T) Message

Msg returns a message with this code, its level, the given text and payload. The time and action are left for the sender to set.

type ConfirmCode

type ConfirmCode[T any] struct {
	ID          string
	Level       Level
	Description string
}

ConfirmCode is a kind of yes/no request, with its payload type T. Its default response is always yes (true).

func (ConfirmCode[T]) Data

func (c ConfirmCode[T]) Data(msg Message) (T, bool)

Data returns msg's payload, and whether msg has this code and a payload of type T.

func (ConfirmCode[T]) Is

func (c ConfirmCode[T]) Is(msg Message) bool

Is reports whether msg has this code.

func (ConfirmCode[T]) Req

func (c ConfirmCode[T]) Req(text string, payload T) Request

Req returns a request with this code, the given text and payload, and a default response of yes.

type ConfirmationRequest

type ConfirmationRequest struct {
	// Motivation is why the action needs confirming, which a host may show the person it asks.
	Motivation string

	// Concurrency is the number of operations in progress, when there is more than one, in which case a host may decide that asking is too confusing; zero means there are none.
	Concurrency int
}

ConfirmationRequest is the payload of a request to confirm an action, such as destroying stacks (CDK_TOOLKIT_I7010) or rolling back during a deployment (CDK_TOOLKIT_I5050).

type ContextProviderMessageSource

type ContextProviderMessageSource struct {
	// Provider names the context provider, such as "vpc-provider", or "plugin:<name>" for a plugin.
	Provider string
}

ContextProviderMessageSource is the payload of a message a context provider sends (CDK_ASSEMBLY_I0300 and CDK_ASSEMBLY_I0301).

type DeployConfirmationRequest

type DeployConfirmationRequest struct {
	ConfirmationRequest

	// PermissionChangeType is what the deployment does to permissions, the most severe of the stack's and its nested stacks'.
	PermissionChangeType cfndiff.PermissionChange

	// TemplateDiffs are the stack's diff and its nested stacks', as the question shows them.
	TemplateDiffs StackDiffs

	// DestructiveChanges are the changes in TemplateDiffs that replace, delete or orphan an existing resource, the stack's own then its nested stacks', as [StackDiff]'s are; it is nil when there are none.
	DestructiveChanges []DestructiveChange

	// ChangeSet is the change set the deployment will execute, as CloudFormation described it, with every page of its changes; it is nil for a direct deployment, which has none.
	// Upstream's payload has no such field.
	ChangeSet *cloudformation.DescribeChangeSetOutput
}

DeployConfirmationRequest is the payload of the request to confirm a stack's deployment (CDK_TOOLKIT_I5060): upstream's DeployConfirmationRequest, with its diffs as a tree rather than a map by name, and the change set.

type DeployStackResult

type DeployStackResult struct {
	// NoOp says the deployment changed nothing.
	NoOp bool

	// StackARN is the stack's ARN.
	StackARN string

	// Outputs are the stack's outputs, by key.
	Outputs map[string]string

	// ChangeSet is the change set, when it was prepared and not executed.
	ChangeSet *cloudformation.DescribeChangeSetOutput

	// DeleteFailures are the resources CloudFormation failed to delete during an update, and skipped.
	DeleteFailures []ResourceDeleteFailure

	// StabilizingResources are the resources that express mode reported complete while they were still settling.
	StabilizingResources []StabilizingResource
}

DeployStackResult is the payload of the message that reports a stack deployed, or left as it was (CDK_TOOLKIT_I5900): upstream's SuccessfulDeployStackResult.

type DestructiveChange

type DestructiveChange struct {
	// StackName is the name of the stack that holds the resource, as its header shows it: the root's display name, or a nested stack's physical name or, when it isn't deployed, its logical ID.
	StackName string

	// LogicalID is the resource's logical ID.
	LogicalID string

	// ResourceType is the resource's type, the deployed one when there is one, or empty when neither template gives one.
	ResourceType string

	// ConstructPath is the resource's construct path, as the diff shows it, or empty when none is known.
	ConstructPath string

	// Impact is what the change does to the existing resource: [cfndiff.WillReplace], [cfndiff.MayReplace], [cfndiff.WillDestroy] or [cfndiff.WillOrphan].
	Impact cfndiff.ResourceImpact

	// Move is where the resource moved to, when the change was found to be a move between stacks, or nil.
	// A deployment still destroys or orphans a moved resource unless it is refactored first.
	Move *cfndiff.Move
}

DestructiveChange is a resource change that replaces, deletes or orphans an existing physical resource: upstream's DestructiveChange.

Changes are listed per node of the diff's tree, as the diffs are (J.6-D2).

type DiagnosedStack

type DiagnosedStack struct {
	// StackName is the name of the stack in CloudFormation.
	StackName string

	// HierarchicalID is the stack's hierarchical ID, such as "Prod/Service".
	HierarchicalID string

	// Result is what the diagnosis found.
	Result StackDiagnosis
}

DiagnosedStack is the diagnosis of one stack: upstream's DiagnosedStack, the payload of the messages that report it (CDK_TOOLKIT_I9500, CDK_TOOLKIT_E9500 and CDK_TOOLKIT_W9501), and an entry of the diagnose action's result.

type DiagnosisKind

type DiagnosisKind string

DiagnosisKind is the outcome of a stack's diagnosis; its values are upstream's.

const (
	// DiagnosisNoProblem is a diagnosis that found nothing wrong.
	DiagnosisNoProblem DiagnosisKind = "no-problem"

	// DiagnosisProblem is a diagnosis that found a problem, which [StackDiagnosis.Problem] describes.
	DiagnosisProblem DiagnosisKind = "problem"

	// DiagnosisError is a diagnosis that couldn't be made, which [StackDiagnosis.Message] explains.
	DiagnosisError DiagnosisKind = "error-diagnosing"
)

The outcomes of a diagnosis.

type DiffResult

type DiffResult struct {
	SpanEnd

	// NumStacksWithChanges is the number of stacks, nested stacks included, whose shown diff isn't empty.
	NumStacksWithChanges int

	// NumStacksWithSecurityChanges is the number of stacks, nested stacks included, whose diff changes permissions.
	NumStacksWithSecurityChanges int

	// Stacks are the selected stacks' diffs, in the order they were selected.
	Stacks []StackDiff
}

DiffResult is the payload of the message that ends the diff action (CDK_TOOLKIT_I4001): upstream's DiffResult, with the stacks' diffs as a tree (J.6-D2).

type DriftResultPayload

type DriftResultPayload struct {
	// Stack is the stack checked for drift.
	Stack *cloudassembly.Stack

	// Drift is the stack's drift.
	Drift StackDrift
}

DriftResultPayload is the payload of the message that reports one stack's drift (CDK_TOOLKIT_I4590): upstream's DriftResultPayload.

type EnvironmentPayload

type EnvironmentPayload struct {
	Environment cloudassembly.Environment
}

EnvironmentPayload is the payload of a message about one environment, such as the result of bootstrapping it (CDK_TOOLKIT_I9900).

type ErrorPayload

type ErrorPayload struct {
	// Err is the error.
	Err error
}

ErrorPayload is the payload of a message that reports an error the toolkit is about to return, such as an incompatible cloud assembly (CDK_ASSEMBLY_E1111).

type FormattedDiff

type FormattedDiff struct {
	// Diff is the stack's diff, and its nested stacks', as text.
	Diff string

	// Security is the stack's security diff, and its nested stacks', as text, or empty when the diff doesn't change permissions.
	// Upstream fills it with the stack's whole diff, which fixes an upstream defect (J.6-D10).
	Security string
}

FormattedDiff is a stack's diff as text, without colour (J.6-D11): upstream's FormattedDiff.

type FormattedDrift

type FormattedDrift struct {
	// Unchanged lists the resources in sync, under "Resources In Sync".
	Unchanged string

	// Unchecked lists the resources not checked, or whose status is UNKNOWN, under "Unchecked Resources".
	Unchecked string

	// Modified lists the resources modified, each with its property differences, under "Modified Resources".
	Modified string

	// Deleted lists the resources deleted, under "Deleted Resources".
	Deleted string
}

FormattedDrift is the drift of one stack as text, by kind: upstream's FormattedDrift, without colour (K.5-D4). A section is empty when it is absent: when no resource is of its kind, when nothing drifted, for every section but Unchecked, or when CloudFormation returned no records, for every section.

type Host

type Host interface {
	// Notify delivers a message.
	// A non-nil error fails the action that sent the message.
	Notify(ctx context.Context, msg Message) error

	// Request asks the Host to decide something and returns its response.
	// Returning a nil response accepts req.Default.
	// Otherwise the response must have the same dynamic type as req.Default, which today is always bool or string; any other type fails the action.
	// A non-nil error fails the action that sent the request.
	Request(ctx context.Context, req Request) (any, error)
}

Host receives the toolkit's messages and answers its requests.

Implementations must be safe for concurrent use. The toolkit may call Notify and Request from several goroutines at once, for example while deploying stacks concurrently. Messages that belong to one operation, identified by their SpanID, arrive in the order they were sent; there is no ordering between operations.

Messages sent while an action cleans up after its context was cancelled carry a context that isn't cancelled, so that a host that fails messages once their context is done still receives them. Request should return when its context is done, since the toolkit acts on no answer once its context is.

Example

A host matches a message on its code, never on its text or its level, and reads its payload through the code.

package main

import (
	"context"
	"fmt"
	"log"
	"sync"

	"github.com/asteroid-computing/aws-cdk-toolkit/iohost"
	"github.com/asteroid-computing/aws-cdk-toolkit/toolkit"
)

// stackCounter is a host that matches messages on their codes, and takes each payload as the type its code names.
// It is safe for concurrent use, as a Host must be.
type stackCounter struct {
	mu     sync.Mutex
	listed int
}

func (h *stackCounter) Notify(_ context.Context, msg iohost.Message) error {
	if list, ok := iohost.ToolkitI2901.Data(msg); ok {
		h.mu.Lock()
		defer h.mu.Unlock()
		h.listed += len(list.Stacks)
	}
	return nil
}

// Request answers nothing, which accepts the request's default.
func (h *stackCounter) Request(context.Context, iohost.Request) (any, error) {
	return nil, nil
}

func main() {
	h := &stackCounter{}
	tk, err := toolkit.New(toolkit.Options{Host: h})
	if err != nil {
		log.Fatal(err)
	}

	src := toolkit.FromAssemblyDirectory("../toolkit/testdata/example/cdk.out", toolkit.AssemblyDirectoryOptions{})
	if _, err := tk.List(context.Background(), src, toolkit.ListOptions{}); err != nil {
		log.Fatal(err)
	}
	fmt.Println("stacks listed:", h.listed)
}
Output:
stacks listed: 2

type HotswapDeploymentAttempt

type HotswapDeploymentAttempt struct {
	// Stack is the stack being deployed.
	Stack *cloudassembly.Stack

	// Mode is the mode the hotswap deployment was started with.
	Mode HotswapMode
}

HotswapDeploymentAttempt is the payload of the message that starts a hotswap deployment (CDK_TOOLKIT_I5400): upstream's HotswapDeploymentAttempt.

type HotswapDeploymentDetails

type HotswapDeploymentDetails struct {
	// Stack is the stack being deployed.
	Stack *cloudassembly.Stack

	// Mode is the mode the hotswap deployment was started with.
	Mode HotswapMode

	// HotswappableChanges are the changes that can be hotswapped, nested stacks' first.
	HotswappableChanges []HotswappableChange

	// NonHotswappableChanges are the changes that can't, nested stacks' first.
	NonHotswappableChanges []NonHotswappableChange
}

HotswapDeploymentDetails is the payload of the message that reports a hotswap deployment's plan (CDK_TOOLKIT_I5401): upstream's HotswapDeploymentDetails.

type HotswapMode

type HotswapMode string

HotswapMode is how a hotswap deployment treats the changes it can't hotswap: upstream's hotswap mode, with its strings.

const (
	// HotswapOnly skips the changes that can't be hotswapped, and hotswaps the rest: upstream's hotswap-only.
	HotswapOnly HotswapMode = "hotswap-only"

	// HotswapFallBack deploys the stack through CloudFormation instead when any change can't be hotswapped: upstream's fall-back.
	HotswapFallBack HotswapMode = "fall-back"
)

The hotswap modes.

type HotswapResult

type HotswapResult struct {
	SpanEnd
	HotswapDeploymentDetails

	// Hotswapped reports whether the changes were hotswapped: false when applying them failed, or when, in fall-back mode, some can't be and a full deployment may follow.
	Hotswapped bool

	// HotswapFallback reports that some changes can't be hotswapped in fall-back mode, so a full deployment is attempted instead.
	HotswapFallback bool

	// Err is the error applying the changes failed with, or nil; when it is set, Hotswapped is false.
	Err error
}

HotswapResult is the payload of the message that ends a hotswap deployment (CDK_TOOLKIT_I5410): upstream's HotswapResult.

type HotswappableChange

type HotswappableChange struct {
	// Cause is the resource change the hotswap applies.
	Cause ResourceChange

	// Resources are the resources the hotswap updates.
	Resources []AffectedResource
}

HotswappableChange is a change that can be hotswapped, the payload of the messages that report applying it (CDK_TOOLKIT_I5402 and CDK_TOOLKIT_I5403): upstream's HotswappableChange.

type Level

type Level int

Level is a message's recommended level.

Levels are ordered from the most to the least verbose, and a host that shows messages at one level also shows every level above it: compare them with >=. The values line up with log/slog's levels, so slog.Level(l) is the natural slog level for l, and the zero value is LevelInfo, the usual threshold.

const (
	// LevelTrace is detail for debugging the toolkit itself.
	LevelTrace Level = -8

	// LevelDebug is detail for debugging a deployment.
	LevelDebug Level = -4

	// LevelInfo is ordinary progress.
	LevelInfo Level = 0

	// LevelWarn is a problem that doesn't stop the action.
	LevelWarn Level = 4

	// LevelResult is the output an action exists to produce, such as a synthesized template or a list of stacks.
	LevelResult Level = 6

	// LevelError is a failure.
	LevelError Level = 8
)

func (Level) String

func (l Level) String() string

String returns upstream's name for the level, such as "info", or "Level(n)" for a value that is not one of the constants.

type MFATokenRequest

type MFATokenRequest struct {
	// DeviceARN is the ARN, or serial number, of the MFA device a token is needed for.
	DeviceARN string
}

MFATokenRequest is the payload of the request for an MFA token (CDK_SDK_I1100): upstream's MfaTokenRequest. The answer is the token, as text.

type Message

type Message struct {
	// Time is when the message was sent.
	Time time.Time

	// Level is the message's recommended level.
	// It is indicative only and may change between releases: match messages on Code instead.
	Level Level

	// Action is the toolkit action that sent the message.
	Action Action

	// Code identifies the kind of message and the type of its Data, in the form CDK_<CATEGORY>_<E|W|I><4 digits>, for example "CDK_TOOLKIT_I5502".
	// The letter is E for errors, W for warnings and I for everything else.
	// A message without a code is generic and has no Data.
	Code string

	// Text is the message itself.
	// It is safe to show a person.
	Text string

	// SpanID groups the messages of one operation, such as the deployment of one stack.
	// It is otherwise meaningless, and empty for a message that belongs to no operation.
	SpanID string

	// Data is the message's payload, whose type is determined by Code.
	Data any
}

Message is one message from the toolkit.

type MissingContext

type MissingContext struct {
	// MissingKeys are the keys of the context the app is missing.
	MissingKeys []string
}

MissingContext is the payload of the messages that report a round of context lookups (CDK_ASSEMBLY_I0240 and CDK_ASSEMBLY_I0241).

type NestedStackDiff

type NestedStackDiff struct {
	// LogicalID is the nested stack's logical ID in its parent's template.
	LogicalID string

	// PhysicalName is the deployed nested stack's name, or empty when it isn't deployed.
	PhysicalName string

	// StackDiffs are the nested stack's diff and its own nested stacks'.
	StackDiffs
}

NestedStackDiff is a nested stack's diff, and its own nested stacks'.

type NonHotswappableChange

type NonHotswappableChange struct {
	// Subject is what changed.
	Subject RejectionSubject

	// Reason is why the change can't be hotswapped.
	Reason NonHotswappableReason

	// Description says why for people, naming the change.
	Description string
}

NonHotswappableChange is a change that can't be hotswapped: upstream's NonHotswappableChange.

type NonHotswappableReason

type NonHotswappableReason string

NonHotswappableReason is why a change can't be hotswapped: upstream's NonHotswappableReason, with its strings.

const (
	// ReasonTags is a change to Tags only, which isn't hotswappable.
	ReasonTags NonHotswappableReason = "tags"

	// ReasonProperties is a change to properties that aren't hotswappable on the resource's type.
	ReasonProperties NonHotswappableReason = "properties"

	// ReasonOutput is a change to a stack output.
	ReasonOutput NonHotswappableReason = "output"

	// ReasonDependencyUnsupported is a change a resource depends on that isn't hotswappable.
	ReasonDependencyUnsupported NonHotswappableReason = "dependency-unsupported"

	// ReasonResourceUnsupported is a change to a resource whose type, or whose change, can't be hotswapped.
	ReasonResourceUnsupported NonHotswappableReason = "resource-unsupported"

	// ReasonResourceCreation is a resource the deployment creates.
	ReasonResourceCreation NonHotswappableReason = "resource-creation"

	// ReasonResourceDeletion is a resource the deployment deletes.
	ReasonResourceDeletion NonHotswappableReason = "resource-deletion"

	// ReasonResourceTypeChanged is a resource whose type changes.
	ReasonResourceTypeChanged NonHotswappableReason = "resource-type-changed"

	// ReasonNestedStackCreation is a nested stack the deployment creates.
	ReasonNestedStackCreation NonHotswappableReason = "nested-stack-creation"
)

The reasons a change can't be hotswapped.

type Operation

type Operation struct {
	SpanEnd

	// Err is the failure, or nil if the operation succeeded.
	Err error
}

Operation is the payload of a message that reports an operation that took time and may have failed, such as synthesis.

type PublishAsset

type PublishAsset struct {
	// Asset is the asset and the destination it is being published to.
	Asset cloudassembly.AssetEntry
}

PublishAsset is the payload of the message that starts publishing one asset to one destination (CDK_TOOLKIT_I5220): upstream's PublishAsset.

type PublishAssetEvent

type PublishAssetEvent struct {
	// Type is the kind of event.
	Type AssetEventType

	// Message is the message's text: the stack name, when there is one, the type and the event's own text, as "Stack: upload: Upload s3://bucket/key".
	Message string

	// ProgressPercentage is how far the asset's build or publish has got: 0 until it finishes, and 100 once it has succeeded or failed.
	// Upstream counts builds and publishes over the entries of the asset's manifest, so that its figure passes 100 (H.2-D8).
	ProgressPercentage int

	// Asset is the asset the event is about, with the destination it is being published to, which upstream documents but never sets (H.2-D8).
	Asset cloudassembly.AssetEntry
}

PublishAssetEvent is the payload of the messages that report building and publishing assets (CDK_ASSETS_I5270, CDK_ASSETS_I5271, CDK_ASSETS_I5275 and CDK_ASSETS_E5279): upstream's PublishAssetEvent.

type QuestionCode

type QuestionCode[T any] struct {
	ID          string
	Level       Level
	Description string
}

QuestionCode is a kind of request with a free-text answer, with its payload type T. Each request carries its own default answer.

func (QuestionCode[T]) Data

func (c QuestionCode[T]) Data(msg Message) (T, bool)

Data returns msg's payload, and whether msg has this code and a payload of type T.

func (QuestionCode[T]) Is

func (c QuestionCode[T]) Is(msg Message) bool

Is reports whether msg has this code.

func (QuestionCode[T]) Req

func (c QuestionCode[T]) Req(text string, payload T, answer string) Request

Req returns a request with this code, the given text and payload, and the given default answer.

type RejectionSubject

type RejectionSubject struct {
	// Type is "Resource" or "Output".
	Type string

	// LogicalID is the resource's or output's logical ID.
	LogicalID string

	// ResourceType is the resource's CloudFormation type, and empty for an output.
	ResourceType string

	// RejectedProperties are the resource's properties whose changes are the cause, in the template's order, and nil for an output and for a resource created, deleted or whose type changed.
	RejectedProperties []string

	// Metadata is the metadata of the construct that defines the resource, or nil when the cloud assembly has none for it, as for a resource the deployment deletes.
	Metadata *cloudassembly.ResourceMetadata
}

RejectionSubject is what a NonHotswappableChange changes: upstream's ResourceSubject or OutputSubject, told apart by Type.

type Request

type Request struct {
	Message

	// Default is the response the toolkit uses when the Host returns none.
	// Its dynamic type is the type of response the request expects: bool for a yes/no confirmation, string for a question.
	Default any
}

Request is a message that asks the Host to decide something.

Example

A request carries the response the toolkit uses when its host gives none. A host answers with a value of the default's type, such as false to decline a deployment.

package main

import (
	"fmt"

	"github.com/asteroid-computing/aws-cdk-toolkit/iohost"
)

func main() {
	req := iohost.ToolkitI5060.Req("Do you wish to deploy these changes?", iohost.DeployConfirmationRequest{})
	fmt.Println(req.Default, req.DefaultNote())
}
Output:
true (auto-confirmed)

func (Request) DefaultNote

func (r Request) DefaultNote() string

DefaultNote returns upstream's note for a request a host answers with its default without asking anyone: "(auto-confirmed)" or "(auto-denied)" for a yes/no request, otherwise "(auto-responded with default: <default>)". Non-interactive hosts append it to the request's text when they report the request.

type RequireApproval

type RequireApproval string

RequireApproval is which deployments a person must approve: upstream's RequireApproval, the CDK CLI's --require-approval, whose default is RequireApprovalBroadening. The toolkit asks CDK_TOOLKIT_I5060 before every deployment with changes, whatever the policy, as upstream's does; a host applies a policy with NeedsApproval.

const (
	// RequireApprovalNever approves every deployment without asking.
	RequireApprovalNever RequireApproval = "never"
	// RequireApprovalAnyChange asks about every deployment it is asked to approve.
	RequireApprovalAnyChange RequireApproval = "any-change"
	// RequireApprovalBroadening asks about a deployment that broadens permissions.
	RequireApprovalBroadening RequireApproval = "broadening"
	// RequireApprovalDestructive asks about a deployment that replaces, deletes or orphans an existing resource.
	RequireApprovalDestructive RequireApproval = "destructive"
)

The policies the CDK CLI offers.

type ResourceChange

type ResourceChange struct {
	// LogicalID is the resource's logical ID.
	LogicalID string

	// OldValue and NewValue are the resource as deployed and as it will be.
	OldValue, NewValue *cfndiff.Object

	// PropertyUpdates are the properties that changed, in the template's order.
	PropertyUpdates *cfndiff.Collection[*cfndiff.Difference]

	// Metadata is the metadata of the construct that defines the resource, or nil when the cloud assembly has none for it.
	Metadata *cloudassembly.ResourceMetadata
}

ResourceChange is a change to one resource of a stack's template: upstream's ResourceChange.

type ResourceDeleteFailure

type ResourceDeleteFailure struct {
	LogicalResourceID string

	// PhysicalResourceID is empty when CloudFormation didn't report one.
	PhysicalResourceID string

	ResourceType string
	Reason       string
}

ResourceDeleteFailure is a resource CloudFormation failed to delete during a stack update, and skipped: upstream's ResourceDeleteFailure.

type SDKTrace

type SDKTrace struct {
	// SDKLevel is the level the SDK reported at: "info" for a call that succeeded, "error" for one that failed, and "warn" for a warning.
	SDKLevel string

	// Content is the trace, such as "SSM.GetParameter -> OK".
	Content string
}

SDKTrace is the payload of a trace from the AWS SDK (CDK_SDK_I0100): one line per API call, and the SDK's own warnings.

Upstream's content is the JavaScript SDK's raw log arguments, which include each call's input and output. This port's is the line as text, and never includes a call's input, which may hold secrets the Go SDK cannot redact.

type SingleStack

type SingleStack struct {
	// Stack is the stack.
	Stack *cloudassembly.Stack
}

SingleStack is the payload of a message about one stack, such as the warning that no drift results are available for it (CDK_TOOLKIT_W4591): upstream's SingleStack.

type SlogHost

type SlogHost struct {
	// Logger receives the records.
	Logger *slog.Logger

	// WithData adds each message's payload as a "data" attribute.
	// It is off by default because some payloads are large, such as whole templates.
	WithData bool
}

SlogHost is a Host that logs every message to a slog.Logger and answers every request with its default.

Each message becomes one record at slog.Level(msg.Level), with msg.Time as the record's time and msg.Text as its message. The record's attributes are "action", and "code" and "span" when the message has them.

func NewSlogHost

func NewSlogHost(logger *slog.Logger) *SlogHost

NewSlogHost returns a SlogHost that logs to logger.

func (*SlogHost) Notify

func (h *SlogHost) Notify(ctx context.Context, msg Message) error

Notify logs msg, and returns the handler's error.

func (*SlogHost) Request

func (h *SlogHost) Request(ctx context.Context, req Request) (any, error)

Request logs req with Request.DefaultNote appended to its text, and answers with the default.

type SpanEnd

type SpanEnd struct {
	// Duration is how long the operation took.
	Duration time.Duration

	// Counters are the counts the operation kept, such as the number of stacks it synthesized, keyed by upstream's names.
	// It is nil when the operation counted nothing.
	Counters map[string]int
}

SpanEnd is the payload of a message that reports how long something took, most often the message that ends an operation. It is upstream's Duration payload, together with the counters upstream adds to it at the end of an operation. Payloads of other messages that end an operation embed it.

func (*SpanEnd) SetSpanEnd

func (e *SpanEnd) SetSpanEnd(v SpanEnd)

SetSpanEnd replaces e with v. The toolkit calls it, through the payload types that embed SpanEnd, to fill in the duration and counters when an operation ends.

type StabilizingResource

type StabilizingResource struct {
	LogicalResourceID string
	ResourceType      string
	Reason            string
}

StabilizingResource is a resource that express mode reported complete while it was still settling, with the reason CloudFormation gave: upstream's StabilizingResource.

type StackActivity

type StackActivity struct {
	// Deployment identifies the deployment the event belongs to.
	Deployment string

	// Event is the stack event, as the CloudFormation API returns it.
	Event types.StackEvent

	// Metadata describes the construct that defines the resource, when the toolkit can find it.
	Metadata *cloudassembly.ResourceMetadata

	// Progress is how far the deployment has got.
	Progress StackProgress
}

StackActivity is the payload of a message reporting one CloudFormation stack event during a deployment (CDK_TOOLKIT_I5502).

type StackAndAssemblyData

type StackAndAssemblyData struct {
	AssemblyData

	// Stack is the stack selected.
	Stack StackData
}

StackAndAssemblyData is the payload of the message that reports a synthesis that selected one stack (CDK_TOOLKIT_I1901).

type StackArtifact

type StackArtifact = *cloudassembly.Stack

StackArtifact is the payload of a message about one stack, such as the result of destroying it (CDK_TOOLKIT_I7900): the stack's cloud assembly artifact.

type StackData

type StackData struct {
	// StackName is the name of the stack in CloudFormation.
	StackName string

	// HierarchicalID is the stack's hierarchical ID, such as "Prod/Service".
	HierarchicalID string

	// Template is the stack's template, as decoded JSON, without the CheckBootstrapVersion rule the toolkit hides from people.
	Template map[string]any

	// StringifiedJSON is Template as JSON, indented by two spaces, as JavaScript's JSON.stringify writes it.
	StringifiedJSON string

	// StringifiedYAML is Template as YAML, as the CDK CLI writes it.
	StringifiedYAML string
}

StackData is a stack and its template.

type StackDependency

type StackDependency struct {
	// ID is the stack's display name.
	ID string

	// Dependencies are the stacks this one depends on.
	Dependencies []StackDependency
}

StackDependency is a stack another depends on, with the stacks it depends on in turn.

type StackDeployProgress

type StackDeployProgress struct {
	// Total is the number of stacks selected, and Current this one's place among them, from 1, in the order they were selected.
	Total   int
	Current int

	// Stack is the stack being deployed.
	Stack *cloudassembly.Stack
}

StackDeployProgress is the payload of the message that starts deploying one stack (CDK_TOOLKIT_I5100): upstream's StackDeployProgress.

type StackDestroy

type StackDestroy struct {
	// Stacks are the stacks to destroy.
	Stacks []*cloudassembly.Stack
}

StackDestroy is the payload of the message that starts destroying stacks (CDK_TOOLKIT_I7101).

type StackDestroyProgress

type StackDestroyProgress struct {
	// Total is the number of stacks being destroyed, and Current this one's place among them, from 1, counted as each starts.
	Total   int
	Current int

	// Stack is the stack being destroyed.
	Stack *cloudassembly.Stack
}

StackDestroyProgress is the payload of the message that starts destroying one stack (CDK_TOOLKIT_I7100).

type StackDetails

type StackDetails struct {
	// ID is the stack's display name, such as "Prod/Service (prod-service)".
	ID string

	// Name is the name of the stack in CloudFormation.
	Name string

	// Environment is the account and region the stack deploys to.
	Environment cloudassembly.Environment

	// Metadata are the metadata entries of the stack's constructs, keyed by construct path.
	Metadata cloudassembly.OrderedMap[[]cloudassembly.MetadataEntry]

	// Dependencies are the stacks this one depends on, each with its own dependencies.
	Dependencies []StackDependency
}

StackDetails describes a stack and the stacks it depends on.

type StackDetailsPayload

type StackDetailsPayload struct {
	// Stacks are the stacks listed.
	Stacks []StackDetails
}

StackDetailsPayload is the payload of the message that lists stacks (CDK_TOOLKIT_I2901).

type StackDiagnosis

type StackDiagnosis struct {
	Kind DiagnosisKind

	// Problem is the problem found, for a diagnosis of kind [DiagnosisProblem]: the same type a failed deployment's error carries as [cdkerr.Error.Diagnosis].
	Problem *cdkerr.Diagnosis

	// Message says why the diagnosis couldn't be made, for a diagnosis of kind [DiagnosisError].
	Message string

	// Err is the error that stopped a diagnosis of kind [DiagnosisError], if one did, such as AWS denying access; upstream keeps only its message.
	Err error
}

StackDiagnosis is what a stack's diagnosis found: upstream's StackDiagnosis union, as a struct with a kind (M.9-D1).

type StackDiff

type StackDiff struct {
	// StackDiffs are the stack's diff and its nested stacks', as shown.
	StackDiffs

	// Stack is the stack diffed.
	Stack *cloudassembly.Stack

	// NumStacksWithChanges is the number of stacks, the stack and its nested stacks, whose shown diff isn't empty.
	NumStacksWithChanges int

	// NumStacksWithSecurityChanges is the number of stacks, the stack and its nested stacks, whose diff changes permissions.
	NumStacksWithSecurityChanges int

	// PermissionChanges is what the diff does to permissions, the most severe of the stack's and its nested stacks'.
	// It comes from the diffs before they were filtered for display, as upstream computes it (J.6-D5), so a host that recomputes it from the diffs here may get another answer.
	PermissionChanges cfndiff.PermissionChange

	// FormattedDiff is the diff as text.
	FormattedDiff FormattedDiff

	// DestructiveChanges are the changes, in the stack and its nested stacks, that replace, delete or orphan an existing resource, as the diffs shown have them: the stack's own, then each nested stack's in the order StackDiffs lists them.
	// It is nil when there are none.
	DestructiveChanges []DestructiveChange
}

StackDiff is the payload of the message that reports one stack's diff (CDK_TOOLKIT_I4002), and an entry of the diff action's result: upstream's StackDiff, with its diffs as a tree rather than a map by name (J.6-D2).

type StackDiffs

type StackDiffs struct {
	// Diff is the stack's own diff.
	Diff *cfndiff.TemplateDiff

	// Nested are the diffs of the stack's nested stacks, in the order its template lists them.
	Nested []NestedStackDiff
}

StackDiffs are a stack's diff and its nested stacks', as they were shown: filtered for display unless the diff was strict, so without the AWS::CDK::Metadata resource, the CheckBootstrapVersion rule, or changes that are likely mangled characters (J.6-D4, J.6-D5).

The diffs encode as JSON as cfndiff.TemplateDiff says, with every difference in their collections.

type StackDrift

type StackDrift struct {
	// StackName is the name the stack is deployed as.
	StackName string

	// DisplayName is the stack's display name, upstream's key for the stack's result.
	DisplayName string

	// Environment is the stack's environment, resolved, so that an environment-agnostic stack's names the account and region it was checked in (G.8-D6).
	Environment cloudassembly.Environment

	// NumResourcesWithDrift is the number of resources CloudFormation found modified or deleted, not counting the CDK's metadata resource.
	NumResourcesWithDrift int

	// NumResourcesUnchecked is the number of the template's resources, not counting the CDK's metadata resource, that have no drift record, or one with status UNKNOWN.
	NumResourcesUnchecked int

	// ResourceDrifts are the stack's resource drift records, as CloudFormation returned them: every page, as upstream's are since toolkit-lib 1.44.0 (K.5-D1).
	ResourceDrifts []types.StackResourceDrift

	// Formatted is the drift as upstream's formatter writes it, without colour (K.5-D4).
	Formatted FormattedDrift
}

StackDrift is the drift of one stack: upstream's DriftResult, with what it was computed from (K.5-D3). It is an entry of the drift action's result, and part of the payload of CDK_TOOLKIT_I4590.

type StackMonitoringControlEvent

type StackMonitoringControlEvent struct {
	// Deployment identifies the deployment being monitored.
	Deployment string

	// Stack is the stack's cloud assembly artifact.
	// Activity printers size their resource-type column from its template, and use their minimum width when it is nil.
	Stack *cloudassembly.Stack

	// StackName is the name of the stack being deployed.
	StackName string

	// ResourcesTotal is the number of resources the deployment will touch, or 0 when that isn't known.
	ResourcesTotal int

	// IsStackUpdate reports whether the deployment updates an existing stack rather than creating one.
	// During an update CloudFormation skips resources it fails to delete, so printers treat those failures as provisional.
	IsStackUpdate bool
}

StackMonitoringControlEvent is the payload of the messages that start and stop the monitoring of one stack's deployment events (CDK_TOOLKIT_I5501 and CDK_TOOLKIT_I5503).

type StackProgress

type StackProgress struct {
	// Total is the number of resources the deployment will touch, or 0 when that isn't known.
	Total int

	// Completed is the number of resources the deployment has finished with.
	Completed int

	// Formatted is the progress as upstream prints it, such as "34/42", or just "34" when the total isn't known.
	Formatted string
}

StackProgress is how far a deployment has got.

type StackRollbackProgress

type StackRollbackProgress struct {
	// Total is the number of stacks selected, and Current this one's place among them, from 1.
	Total   int
	Current int

	// Stack is the stack being rolled back.
	Stack *cloudassembly.Stack
}

StackRollbackProgress is the payload of the message that starts rolling back one stack (CDK_TOOLKIT_I6100): upstream's StackRollbackProgress.

type StackSelectionDetails

type StackSelectionDetails struct {
	// Stacks is the selection the action will make from the assembly.
	Stacks cloudassembly.Selector
}

StackSelectionDetails is the payload of the message that starts synthesis (CDK_TOOLKIT_I1001).

type UpdatedContext

type UpdatedContext struct {
	// Context holds the values found, by key; a lookup that failed holds a transient error value.
	Context map[string]jsontext.Value
}

UpdatedContext is the payload of the message that reports the context lookups found (CDK_ASSEMBLY_I0042).

type ValidateResult

type ValidateResult struct {
	// Conclusion is [cloudassembly.ConclusionFailure] when any plugin report failed, and [cloudassembly.ConclusionSuccess] otherwise.
	Conclusion string

	// Title is the report's title, if it has one.
	Title string

	// PluginReports are the plugin reports for the stacks validated: the app's own, filtered to those stacks, and the stacks' annotations as a plugin report of their own.
	PluginReports []cloudassembly.PluginReport
}

ValidateResult is the payload of the messages that report the assembly's validation report (CDK_TOOLKIT_E9600 and CDK_TOOLKIT_I9600).

Directories

Path Synopsis
Package console provides hosts that write the toolkit's messages to a terminal or a log stream: a Go port of upstream's NonInteractiveIoHost.
Package console provides hosts that write the toolkit's messages to a terminal or a log stream: a Go port of upstream's NonInteractiveIoHost.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL