import { type ResourceEvent, type FailureAnalysis } from "@fjall/util/aws"; export type { ResourceEvent, FailureAnalysis } from "@fjall/util/aws"; export type { AwsClientLike, EventFloor, EventLogWriter, EventFailureAnalyser, EventLogWriterFactory, EventMonitorDeps, StackResourceStatusRead, StackStatusRead } from "./cloudformationEventTypes.js"; import { type AwsClientLike, type EventFloor, type EventLogWriter, type EventMonitorDeps, type StackResourceStatusRead, type StackStatusRead } from "./cloudformationEventTypes.js"; export declare class CloudFormationEventMonitor { private aws; private seenEventIds; private isMonitoring; private pollInterval; private activeNestedStacks; private failureReasons; private eventHistory; private eventLogger; private failureAnalyser; private eventLogWriterFactory; private onFailureAnalysis; private lastAnalysis; private stackName; private maxHistorySize; private maxSeenEventIds; private ipamTracker; private eventCutoffMs; private tokenLatchCutoffMs; private eventFloors; private operation; constructor(aws: AwsClientLike, deps?: EventMonitorDeps); enableLogging(deploymentId: string, stackName: string, region: string, deploymentName?: string): void; /** * Never dispatch, nor read as terminal, an event of `stackName` at or * before `floor`. It holds for every later `startMonitoring` and * `waitForStackComplete` of this monitor, the re-attach's included, and * whether or not the prime poll answered. */ setEventFloor(stackName: string, floor: EventFloor): void; startMonitoring(stackName: string, onResourceUpdate: (event: ResourceEvent) => void, onStackComplete?: (success: boolean, message?: string) => void): Promise; stopMonitoring(): void; private cleanup; private handleStackComplete; getResourceHistory(logicalId: string): ResourceEvent[]; getEventHistory(): Map; getFailureAnalysis(): FailureAnalysis | null; /** The reason of the failure that failed the monitored operation. */ getFirstFailureReason(): string | null; getEventLogger(): EventLogWriter | null; getEventLogPath(): string | null; getLogSummary(): string | null; /** * Watches `stackName` until its operation settles or `timeout` passes. * `afterPrime`, when given, runs once monitoring has absorbed the events * already there and before the wait begins: an operation it starts has * every one of its events dispatched, none taken for the earlier * operation's. A throw from it stops monitoring and rejects the wait. * * `operationToken`, when given, is the request token of the one operation * to follow: no event before that operation's first is dispatched or read * as its end (`PollContext.operation`). It holds for every later wait of * this monitor that names the same token, a re-attach's included, so a * re-attach reads the operation's rollback too. */ waitForStackComplete(stackName: string, options?: { timeout?: number; pollInterval?: number; onResourceUpdate?: (event: ResourceEvent) => void; onStackComplete?: (success: boolean, message?: string) => void; afterPrime?: () => Promise; operationToken?: string; }): Promise<{ success: boolean; status?: string; failureReason?: string; logPath?: string; }>; private pollContext; private pollEvents; getStackStatus(stackName: string, abortSignal?: AbortSignal): Promise<{ status: string; statusReason?: string; } | null>; /** * One DescribeStacks of `stackName`, as `fetchStackStatusRead` reads it: * a read that failed is `unreadable`, never a missing stack. * `getStackStatus` keeps its published answer, which cannot tell the two * apart. */ getStackStatusRead(stackName: string, abortSignal?: AbortSignal): Promise; /** * One DescribeStackResource of `logicalId` in `stackName`, as * `fetchStackResourceStatus` reads it. */ getStackResourceStatus(stackName: string, logicalId: string, abortSignal?: AbortSignal): Promise; getCurrentResources(stackName: string): Promise; }