import type { CloudFormationClient } from "@aws-sdk/client-cloudformation"; import { type CloudWatchLogsClient } from "@aws-sdk/client-cloudwatch-logs"; import type { DeployCallbacks } from "../../types/callbacks.js"; /** * Container Insights mints `/aws/ecs/containerinsights//performance` * itself. No CDK or CloudFormation property owns it, so CFN cannot delete what * it never created and stack deletion always strands it. Every Fjall ECS * cluster enables Container Insights v2 unconditionally (`addCluster` in * `resources/aws/compute/ecs.ts`), so every destroyed app leaks exactly one * group per cluster. * * Shared with the deploy-test residue oracle, which matches the same shape * (`deploy-tests/lib/residueOracle.mts`) — the two must agree or the pipeline * flags residue this reap already removed. */ export declare function insightsLogGroupName(clusterName: string): string; /** * Record the Container Insights log groups the stack's ECS clusters will * strand, so {@link reapInsightsLogGroups} can delete them once the stack is * gone. * * Call BEFORE the destroy — after CFN reports the stack deleted its resource * list is unreadable, and this captured list is the only record of which * groups the reap may touch. Deriving the names from clusters we are about to * delete is what keeps the reap's deletion predicate closed: it can never name * a group belonging to a live cluster, an unrelated app, or a shared * AWS-managed group such as `RDSOSMetrics`. * * Returns [] on any read failure — no capture means no deletion, so a * degraded read leaves today's leak rather than widening the blast radius. */ export declare function captureInsightsLogGroups(cfnClient: CloudFormationClient, stackName: string, abortSignal?: AbortSignal): Promise; export interface InsightsReapSummary { /** Groups deleted by this pass. */ deleted: string[]; /** Groups a delete failed for; each warned via callbacks. */ failed: string[]; } /** * Delete the Container Insights log groups captured before the destroy. * * Run only after CFN reports the stack deleted. Per-group failures warn and * continue — a stranded log group is a cost and tidiness problem, never a * reason to fail a destroy that already succeeded. A group that does not exist * is the ordinary case (a cluster that never ran a task never gets one) and is * neither a deletion nor a failure. */ export declare function reapInsightsLogGroups(logsClient: CloudWatchLogsClient, logGroupNames: readonly string[], callbacks?: DeployCallbacks, abortSignal?: AbortSignal): Promise;