/** * The recreate pre-flight — ONE pure-read pass over EVERY consented stack * BEFORE any recreate surgery mutates anything (drift-remediation plan § * Phase 7 fix pass 1). The surgery's removal phase can only fail EXPENSIVELY * once the snapshot flip has landed (a burned UpdateStack, an orphaned * mid-surgery journal), so every check that can be answered from reads runs * here, pre-capture, across the whole consented set: * * 1. reference scan — `deriveRemovalTemplate` over the live template bytes: * a remaining resource referencing a target fails closed with the paths; * 2. export-consumer scan — every Output the removal would strip that * carries an `Export` is checked via cfn:ListImports: CloudFormation * refuses to drop an export while imports exist, so an imported export * fails closed naming the importing stacks; * 3. delete-blocking probe — targets whose owning service exposes a * delete-refusal setting (RDS DeletionProtection — fjall's own database * constructs default it ON) are probed live: an enabled setting fails * closed pre-capture, because CloudFormation's delete would DELETE_FAILED * mid-surgery after the flip already mutated the stack. * * All-stacks-before-any-flip: a multi-stack consent must never delete stack * A's resource and then discover stack B was doomed — the caller passes every * consented stack and nothing runs until all pass. * * Failure messages are pre-masked at construction (identifier-only content * plus masked SDK error text). */ import { type Result } from "@fjall/generator"; import type { AwsProvider } from "../../aws/AwsProvider.js"; import { type RemediationTarget } from "../../types/remediation.js"; export interface RecreatePreFlightStack { stackName: string; targets: readonly RemediationTarget[]; } export interface RunRecreatePreFlightParams { /** EVERY consented stack — the pass must clear all of them before the * caller flips any. */ stacks: readonly RecreatePreFlightStack[]; abortSignal?: AbortSignal; } /** * Run the merged pre-flight over every consented stack. Pure reads only — * the first failure aborts the whole consented set before any surgery runs. * Safe on resume paths too: targets already absent from the live template * (removal landed) skip their checks. */ export declare function runRecreatePreFlight(aws: AwsProvider, params: RunRecreatePreFlightParams): Promise>;