export interface AwsApplyArgs { /** Path to a built CloudFormation template (JSON/YAML). */ templatePath: string; /** CloudFormation stack name — the deploy boundary. */ stackName: string; /** * CFN endpoint override (e.g. Floci `http://localhost:4566`). Omitted, * `AWS_ENDPOINT_URL_CLOUDFORMATION` then `AWS_ENDPOINT_URL` answer — the same * rule the read client applies (#1694). With neither: real CloudFormation. */ endpoint?: string; /** Region (real CFN host + `Version` context). Default: `us-east-1`. */ region?: string; /** * Capabilities to acknowledge. Default: `CAPABILITY_NAMED_IAM`, plus * `CAPABILITY_AUTO_EXPAND` when the template has a top-level `Transform` (#980). */ capabilities?: string[]; /** Stack-settle timeout in ms. Default: `300000`. */ timeoutMs?: number; /** Poll interval in ms. Default: `3000`. */ intervalMs?: number; } /** Injectable CFN transport — a form POST returning the raw XML. Mirrors the az/gcp appliers so tests avoid the network. */ export type AwsHttp = (url: string, form: Record, signal?: AbortSignal) => Promise<{ status: number; text: string; }>; /** * The CloudFormation endpoint URL — the override, or the real regional host. * `env` is what the ambient-variable fallback reads; injectable for tests. */ export declare function cfnUrl(endpoint?: string, region?: string, env?: Record): string; /** A CFN Query-protocol form body: `Action` + `Version` + params. */ export declare function cfnForm(action: string, params: Record): Record; /** Capabilities as the CFN `Capabilities.member.N` list params. */ export declare function capabilityParams(capabilities: string[]): Record; /** * Stack tags as the CFN `Tags.member.N.Key/Value` list params (#1222). Sorted * so the request is deterministic. Empty in, empty out — a template without an * ownership marker adds no `Tags` parameter at all. */ export declare function tagParams(tags: Record): Record; /** * First `` text in a CFN XML response. * * Assumes flat scalar fields — the CloudFormation Query API returns simple * `` style leaves, so `[^<]*` is sufficient. It does * NOT handle nested tags or XML entities in the value; if a field ever carries * either, replace this with a real XML parser. */ export declare function xmlField(xml: string, tag: string): string | undefined; export declare const stackStatus: (xml: string) => string | undefined; export declare const stackId: (xml: string) => string | undefined; export declare const cfnErrorMessage: (xml: string) => string | undefined; /** A DescribeStacks error for an absent stack (drives create-vs-update). */ export declare const isStackMissing: (xml: string) => boolean; /** The real-AWS UpdateStack no-op error (Floci returns 200 instead). */ export declare const isNoUpdates: (xml: string) => boolean; export declare const isSuccessStatus: (status: string) => boolean; export declare const isFailureStatus: (status: string) => boolean; /** A settled stack state — success, failure, or deleted. Transient `*_IN_PROGRESS` states aren't. */ export declare const isTerminalStatus: (status: string) => boolean; /** Poll DescribeStacks until the stack reaches a terminal state; returns that status. */ export declare function waitForStackSettled(url: string, stackName: string, http: AwsHttp, opts: { timeoutMs: number; intervalMs: number; }, signal?: AbortSignal): Promise; /** * The native AWS applier — deploy a built CloudFormation template by calling the * CloudFormation API directly (create-or-update + poll to a settled stack), * targeting a local Floci emulator or real AWS by endpoint override. The direct * twin of `azApply`/`gcpApply`: it speaks the CloudFormation Query API over HTTP * rather than shelling `aws cloudformation deploy` — and since chant #1449 it is * also what `nativeApply({ target: "cloudformation" })` runs, so no CLI path * remains. The stack is the ownership boundary, so deletes ride CloudFormation * itself — no separate prune. `http` is injectable for tests. */ export declare function awsApply(args: AwsApplyArgs, signal?: AbortSignal, http?: AwsHttp): Promise<{ stackName: string; status: string; action: "created" | "updated" | "unchanged"; }>; /** {@link awsDelete}'s arguments: {@link AwsApplyArgs} minus the template — a * delete needs no body, so teardown (#1222) can call it with a stack name * alone. Op builders that thread `templatePath` through keep working; it is * simply unused here. */ export type AwsDeleteArgs = Omit & { templatePath?: string; }; /** * The inverse of {@link awsApply} — DeleteStack, then poll until the stack is * gone. Idempotent: an already-absent stack is a no-op. `http` is injectable. */ export declare function awsDelete(args: AwsDeleteArgs, signal?: AbortSignal, http?: AwsHttp): Promise<{ stackName: string; deleted: boolean; }>; export interface RollbackStackArgs { /** CloudFormation stack name to roll back. */ stackName: string; /** CFN endpoint override — same resolution rule as {@link AwsApplyArgs.endpoint} (#1694). */ endpoint?: string; /** Region (real CFN host). Default: `us-east-1`. */ region?: string; /** Stack-settle timeout in ms. Default: `300000`. */ timeoutMs?: number; /** Poll interval in ms. Default: `3000`. */ intervalMs?: number; } /** * The saga compensation for {@link awsApply} — CloudFormation `RollbackStack` * via the same Query-API client, then poll until the stack settles. Returns the * stack to its last known stable state after a failed update (#1449 — this * replaces the Temporal lexicon exec-ing `aws cloudformation rollback-stack`). * * Degrades rather than crashes in two cases where there is nothing to do: * an absent stack (nothing applied, nothing to revert) and a target that does * not implement the action — Floci answers `UnknownAction` (#947). Both return * `rolledBack: false` with a logged warning; every other API error throws, * because a compensation that silently fails leaves partial state looking * reverted when it isn't. `http` is injectable for tests. */ export declare function rollbackStack(args: RollbackStackArgs, signal?: AbortSignal, http?: AwsHttp): Promise<{ stackName: string; rolledBack: boolean; status?: string; }>; //# sourceMappingURL=aws-apply.d.ts.map