import type { StackSelector } from '../../api/cloud-assembly/stack-selector'; import type { SourceTrace } from '../../api/source-tracing/types'; export interface DiagnoseOptions { readonly stacks?: StackSelector; /** * How many stacks to do in parallel. * * @default 10 */ readonly concurrency?: number; /** * Toolkit stack name */ readonly toolkitStackName?: string; } export interface DiagnoseResult { readonly stacks: DiagnosedStack[]; } export type StackDiagnosis = { type: 'no-problem'; } | { type: 'problem'; detectedBy: StackProblemSource; problems: TracedResourceError[]; } | { type: 'error-diagnosing'; message: string; }; export type StackProblemSource = { type: 'deployment'; stackStatus: string; statusReason: string; } | { type: 'change-set'; changeSetName: string; changeSetStatus: string; statusReason: string; } | { type: 'early-validation'; changeSetName: string; }; export interface DiagnosedStack { readonly stackName: string; readonly hierarchicalId: string; readonly result: StackDiagnosis; } export interface TracedResourceError { /** * The stack this resource error occurred in */ readonly stackArn: string; /** * Top-level stack name or stack construct path we found the error in */ readonly topLevelStackHierarchicalId: string; /** * IDs of parent stacks of the resource, in case of resources in nested stacks */ readonly parentStackLogicalIds: string[]; /** * Logical ID of the resource * * (May be absent in case this message is about the stack itself) */ readonly logicalId?: string; /** * Resource type */ readonly resourceType?: string; /** * Physical ID of the resource */ readonly physicalId?: string; /** * Error message of the resource */ readonly message: string; /** * Error code of the resource */ readonly errorCode?: string; /** * Optionally a source trace * * (Not optional on purpose so we are not allowed to forget to call the code that should fill it) */ readonly sourceTrace: SourceTrace | undefined; /** * Additional context gathered from AWS service APIs to help diagnose the root cause. * * For example, CloudWatch Logs from an ECS service whose tasks failed to start. */ readonly additionalContext?: AdditionalDiagnosticContext[]; } export interface AdditionalDiagnosticContext { /** * A short structured identifier of where this context came from. * * @example "CloudWatch Logs (log-group-name)" */ readonly source: string; /** * The log lines or messages retrieved */ readonly messages: string[]; /** * An optional console deep link for further investigation */ readonly link?: string; /** * An optional short leader word rendered before the link, e.g. "Tasks" or "Logs". * * Helps distinguish multiple links on a single resource. */ readonly linkLabel?: string; } //# sourceMappingURL=index.d.ts.map