cdk-insights 1.31.3 → 1.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3 @@
1
+ import type { AnalysisResults, CloudFormationStack, CreateFindingFunction } from '../../../../types/analysis.types';
2
+ import type { AppContext } from '../../types';
3
+ export declare const checkDanglingGetStackOutput: (template: CloudFormationStack, createFinding: CreateFindingFunction, appContext?: AppContext) => AnalysisResults;
@@ -8,6 +8,6 @@
8
8
  * Runs client-side only — templates never leave the user's machine.
9
9
  * Free for all users — no backend cost or tier gating.
10
10
  */
11
- export { runAllTemplateLevelChecks, getRegisteredChecks } from './registry';
12
- export type { TemplateLevelCheckFunction, TemplateLevelCheckDefinition, TemplateLevelCategory, } from './types';
11
+ export { getRegisteredChecks, runAllTemplateLevelChecks } from './registry';
12
+ export type { AppContext, TemplateLevelCategory, TemplateLevelCheckDefinition, TemplateLevelCheckFunction, } from './types';
13
13
  export { AWS_SERVICE_LIMITS, WARNING_THRESHOLD } from './types';
@@ -5,12 +5,12 @@
5
5
  * executes them against a CloudFormation template.
6
6
  */
7
7
  import type { AnalysisResults, CloudFormationStack, CreateFindingFunction } from '../../types/analysis.types';
8
- import type { TemplateLevelCheckDefinition } from './types';
8
+ import type { AppContext, TemplateLevelCheckDefinition } from './types';
9
9
  /**
10
10
  * Run all template-level checks against a CloudFormation stack.
11
11
  * Merges results from all checks, tagging each issue with its ruleId.
12
12
  */
13
- export declare const runAllTemplateLevelChecks: (template: CloudFormationStack, createFinding: CreateFindingFunction, ruleFilter?: string[]) => AnalysisResults;
13
+ export declare const runAllTemplateLevelChecks: (template: CloudFormationStack, createFinding: CreateFindingFunction, ruleFilter?: string[], appContext?: AppContext) => AnalysisResults;
14
14
  /**
15
15
  * Get all registered template-level check definitions (for documentation/listing).
16
16
  */
@@ -5,7 +5,7 @@
5
5
  * cross-resource patterns, AWS service limit violations, and policy issues
6
6
  * that cannot be found by analyzing resources individually.
7
7
  */
8
- import type { CloudFormationStack, CreateFindingFunction, AnalysisResults, Severity, WAFPillars } from '../../types/analysis.types';
8
+ import type { AnalysisResults, CloudFormationStack, CreateFindingFunction, Severity, WAFPillars } from '../../types/analysis.types';
9
9
  /**
10
10
  * Category for template-level check rule IDs.
11
11
  * TL-LIMIT-xxx = Service limit checks
@@ -14,6 +14,17 @@ import type { CloudFormationStack, CreateFindingFunction, AnalysisResults, Sever
14
14
  * TL-DRIFT-xxx = CDK L1 schema-drift checks
15
15
  */
16
16
  export type TemplateLevelCategory = 'serviceLimits' | 'crossResourceAntiPatterns' | 'policyAnalysis' | 'schemaDrift';
17
+ /**
18
+ * App-wide context available to template-level checks that need to reason
19
+ * about resources outside the current stack — e.g. validating
20
+ * Fn::GetStackOutput targets against the outputs declared by sibling stacks
21
+ * in the same CDK app. Optional; checks that only look at one template
22
+ * should ignore it.
23
+ */
24
+ export interface AppContext {
25
+ /** outputLogicalIds declared in each stack, keyed by stackName. */
26
+ outputsByStack: Map<string, Set<string>>;
27
+ }
17
28
  /**
18
29
  * A template-level check function.
19
30
  * Receives the FULL CloudFormation stack (all resources).
@@ -22,7 +33,7 @@ export type TemplateLevelCategory = 'serviceLimits' | 'crossResourceAntiPatterns
22
33
  * Intentionally matches the AWSServiceCheckFunction signature so it
23
34
  * integrates seamlessly with the existing pipeline.
24
35
  */
25
- export type TemplateLevelCheckFunction = (template: CloudFormationStack, createFinding: CreateFindingFunction) => AnalysisResults;
36
+ export type TemplateLevelCheckFunction = (template: CloudFormationStack, createFinding: CreateFindingFunction, appContext?: AppContext) => AnalysisResults;
26
37
  /**
27
38
  * Metadata about a registered template-level check.
28
39
  */