import { type ResourceEvent } from "../../aws/utils/cloudformationEvents.js"; import type { DeploymentContext, StepOutput } from "../../types/deployment/DeploymentTypes.js"; import type { AwsProvider } from "../../aws/AwsProvider.js"; import type { Result } from "@fjall/generator"; import type { CdkError } from "../../types/errors/CdkError.js"; import { type CheckDifferencesResult } from "./CdkCommandRunner.js"; import { type HungUpdateWatchOptions } from "./hungUpdateWatch.js"; import { type BootstrapRunFailure } from "./bootstrapConvergence.js"; import type { CdkOptions, CdkOutput, CdkServiceOptions } from "./CdkServiceTypes.js"; export type { CdkContext, CdkOptions, CdkOutput, CdkServiceOptions } from "./CdkServiceTypes.js"; export { type CheckDifferencesResult } from "./CdkCommandRunner.js"; export declare class CdkService { private commandRunner; private eventMonitor; private readonly abortSignal?; private readonly childEnvPolicy; constructor(options: CdkServiceOptions); dispose(): void; checkDifferences(path: string, stackName?: string, options?: CdkOptions): Promise>; deploy(path: string, stackName?: string, options?: CdkOptions): Promise>; destroy(path: string, stackName?: string, options?: CdkOptions): Promise>; runImport(path: string, resourceMappingFile?: string, options?: CdkOptions): Promise>; synth(path: string, options?: CdkOptions): Promise>; bootstrap(accountId: string, region: string, options?: CdkOptions): Promise>; runCdkSynth(context: DeploymentContext, onOutput?: (chunk: string) => void, credentials?: CdkOptions["credentials"]): Promise>; /** * Convergence-first bootstrap protocol: probe the CDKToolkit stack, wait * out any in-flight bootstrap instead of racing its fixed-name changeset, * force only when the desired tag set cannot be confirmed live, and retry * a bounded number of lost races after the winner settles. Retry rather * than declare success on a lost race — the winner may have run a * different CDK version or stamped a different tag set; a no-force retry * short-circuits in seconds when the toolkit already converged. */ runCdkBootstrap(context: DeploymentContext, onOutput?: (chunk: string) => void, credentials?: CdkOptions["credentials"], permissionsBoundary?: string, bootstrapTags?: CdkOptions["bootstrapTags"]): Promise>; runCdkDiff(context: DeploymentContext, onOutput?: (chunk: string) => void): Promise>; runCdkDeploy(context: DeploymentContext, stackPattern?: string, onOutput?: (chunk: string) => void, onResourceProgress?: (event: ResourceEvent) => void, aws?: AwsProvider, credentials?: CdkOptions["credentials"], parameters?: Record, exclusively?: boolean, hungUpdate?: HungUpdateWatchOptions): Promise>; /** Where a stack got to, as the end of a sentence: its status, or that it could not be read. */ private stackWhereabouts; /** * The CDK child died (a network blip or its own timeout) but CloudFormation * reports the operation still running server-side. Reset the monitor * (startMonitoring skips when already live, so waitForStackComplete's * stackComplete closure would never register against a running monitor) * and watch the operation to its terminal state, reporting success/failure * from that status instead of the child's false failure. */ private reattachToInFlightOperation; /** * A zero-exit `cdk deploy` does not prove the stack converged: a transient * network kill — or the retry that follows it — can return success while * CloudFormation has independently settled at a ROLLBACK/FAILED terminal * state. Before reporting a genuine deployment success, probe CloudFormation's * authoritative terminal status and downgrade to failure when the stack rolled * back. NO_CHANGES and skipped-empty-stack outcomes did not mutate the stack, * so their terminal label reflects prior state and passes through untouched. * A stack CloudFormation reports absent is not rollback evidence and keeps * the CDK verdict. A status that could not be read certifies nothing: the * deploy fails, saying the stack's state is unconfirmed. */ private reconcileDeploySuccessAgainstStack; /** * The stack's status, as the recovery probe and the success reconcile read * it. A read that fails in a way a retry may pass is read again after each * of `STATUS_READ_RETRY_BACKOFF_MS`'s waits, unless the deploy is * cancelled. A read that still fails, or fails any other way, is returned * as `unreadable`: it is never absence. */ private readStackStatus; /** Shared by the Q12 merge path and the re-attach failure path. */ private journalDriftSuspects; runCdkDestroy(context: DeploymentContext, stackPattern?: string, onOutput?: (chunk: string) => void, onResourceProgress?: (event: ResourceEvent) => void, aws?: AwsProvider, useCdkOut?: boolean, credentials?: CdkOptions["credentials"]): Promise>; }