/** * Dependency Graph Builder for CloudFormation templates (Phase 2 of #90) * * Scans a resolved CloudFormation template and builds a directed dependency graph * by detecting inter-resource references via Ref, Fn::GetAtt, DependsOn, and Conditions. * * @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference.html */ import type { TemplateDocument } from '../types/template.js'; /** A single directed edge in the dependency graph. */ export interface DependencyEdge { /** The resource that depends on `target`. */ source: string; /** The resource being depended upon. */ target: string; /** How the dependency was discovered. */ type: 'Ref' | 'Fn::GetAtt' | 'DependsOn' | 'Condition'; /** For Fn::GetAtt edges, the attribute name. */ attribute?: string; } /** Metadata for a single resource node in the graph. */ export interface ResourceNode { logicalId: string; resourceType: string; /** Conditions this resource is gated on. */ conditions: string[]; /** Logical IDs this resource directly depends on (union of all edge types). */ dependsOn: Set; /** Logical IDs that directly depend on this resource. */ dependedOnBy: Set; } /** The complete dependency graph for a template. */ export interface DependencyGraph { /** Map of logicalId → ResourceNode. */ nodes: Map; /** All discovered edges. */ edges: DependencyEdge[]; /** Set of all resource logical IDs. */ resourceIds: Set; /** Set of all parameter names (used to exclude Ref targets that are params). */ parameterIds: Set; /** Map of condition name → resource logical IDs that use it. */ conditionUsage: Map>; } /** AWS pseudo-parameters that should not be treated as resource refs. */ export declare const PSEUDO_PARAMETERS: Set; /** * Build a directed dependency graph from a resolved CloudFormation template. * * @param template - A fully resolved CloudFormation template document. * @returns The dependency graph. */ export declare function buildDependencyGraph(template: TemplateDocument): DependencyGraph; //# sourceMappingURL=graph.d.ts.map