/** * What a stack's events say of one update a caller sent (FJL-1014): whether * it ended, whether it ended by rolling back, and which services and * functions the rollback touched. Pure: `stackEventsRead.ts` reads the * events. CloudFormation's own text (an event's `reason`) is carried raw: * mask it where a message is built. */ import type { StackEvent } from "@aws-sdk/client-cloudformation"; /** A stack event with the time CloudFormation logged it, which every event it answers carries. */ export type TimedStackEvent = StackEvent & { readonly Timestamp: Date; }; export declare function isTimedStackEvent(event: StackEvent): event is TimedStackEvent; /** An event of the stack itself. `reason` is CloudFormation's text, raw. */ export interface StackLevelEvent { readonly status: string; readonly timestamp: Date; readonly reason?: string; } /** A resource CloudFormation's rollback failed on. `reason` is CloudFormation's text, raw. */ export interface RollbackFailure { readonly logicalId: string; readonly physicalId?: string; readonly reason?: string; } /** How an operation began: its stack-level start event's time, and its request token when that event carried it. */ export interface OperationStart { readonly timestamp: Date; readonly token?: string; } /** * The first event the follow of an update a caller sent dispatched: the * update's own, since the follow dispatches nothing before an event carrying * the update's request token (`PollContext.operation` in * `cloudformationEventHelpers.ts`). It is the update's start unless the * follow's time cutoff absorbed the start, which a host whose clock runs * ahead of CloudFormation's can make it do, so `isStart` says whether it is * the stack's own UPDATE_IN_PROGRESS. `token` is its request token when the * follow admitted it. */ export interface UpdateAnchor extends OperationStart { readonly isStart: boolean; } /** * Where an operation got to, read from the stack's events. `touchedInRollback` * holds the physical id of every service and function the rollback logged an * event for: an `AWS::ECS::Service`'s is its full service ARN, and an * `AWS::Lambda::Function`'s its function name (read in production us-east-1's * WebAppCompute events on 2026-10-05). */ export type OperationOutcome = { readonly kind: "start-not-found"; } | { readonly kind: "running"; } | { readonly kind: "superseded"; readonly by: StackLevelEvent; } | { readonly kind: "ended"; readonly end: StackLevelEvent; readonly rolledBack: boolean; readonly touchedInRollback: ReadonlySet; readonly rollbackFailures: readonly RollbackFailure[]; }; /** * The status of `event` when it is an event of the stack itself, not of a * nested stack. An event of the stack with no status is never taken for an * operation's start or end: every operation logs its start with one. */ export declare function stackLevelStatus(event: StackEvent, stackName: string): string | undefined; export declare function stackLevelEvent(event: TimedStackEvent, status: string): StackLevelEvent; /** * How the update that began at `start` went, from the stack's events oldest * first. Its start is the stack-level UPDATE_IN_PROGRESS carrying * `start.token`, or logged at `start.timestamp` when no token is given; its * end is the first stack-level status after it that `isTerminalState` * accepts. Every event between them is the operation's, whatever token it * carries: a rollback a cancel began carries the cancel's token or none * (`PollContext.operation` in `aws/utils/cloudformationEventHelpers.ts`), so * the token finds only the start. A stack-level event after the end is * another operation's, which `superseded` names. The rollback phase runs * from a stack-level UPDATE_ROLLBACK_IN_PROGRESS to the end. */ export declare function operationOutcome(events: readonly TimedStackEvent[], stackName: string, start: OperationStart): OperationOutcome;