import type { PolicyValidationPluginReport } from './report'; import type { IPolicyValidationPlugin, IPolicyValidationContext } from './validation'; /** * A custom rule source for the validation engine. */ export interface ValidationRuleSource { /** * The name of the rule source. */ readonly name: string; /** * The rule content (e.g., Rego policy source code). */ readonly content: string; } /** * Properties for configuring the CloudFormationValidatePlugin. */ export interface CloudFormationValidatePluginProps { /** * Custom Rego rules to evaluate in addition to built-in rules. * * @default - no custom rules */ readonly regoRules?: ValidationRuleSource[]; /** * Custom Guard rules to evaluate in addition to built-in rules. * * @default - no guard rules */ readonly guardRules?: ValidationRuleSource[]; /** * Path to a directory containing additional CloudFormation resource provider * schema files (JSON) to merge with the bundled schemas. * * The directory should contain **only** valid CFN resource provider schema * files. All `.json` files found (recursively) are treated as schemas and * must contain a valid JSON object with a `typeName` field. Non-JSON files * (e.g., `.keep`, `.md`) are safely ignored. * * Fails hard on invalid JSON or missing `typeName` in `.json` files to * prevent silent validation gaps. * * Use case: validating templates that use pre-GA CloudFormation properties * not yet in the published registry (e.g., from spec2cdk/temporary-schemas). * * @default - no additional schemas * @internal */ readonly _additionalSchemasDirectory?: string; } /** * Validation plugin that uses the CloudFormation validation engine * to evaluate templates against built-in rules. */ export declare class CloudFormationValidatePlugin implements IPolicyValidationPlugin { /** * The default name of this plugin */ static readonly PLUGIN_NAME = "CloudFormation Validate"; /** * Return a global singleton instance of this plugin. * * This is used because initializing the engine is somewhat expensive, which makes * a noticeable difference in tests. * * @internal */ static _singletonInstance(): CloudFormationValidatePlugin; /** * Pre-configure the singleton with specific props before first access. * Used by test infrastructure to inject schema overlays without per-App registration. * * Must be called before any App synthesis triggers `_singletonInstance()`. * Calling this when a singleton already exists replaces it. * * @internal */ static _configureSingleton(props: CloudFormationValidatePluginProps): void; private static _instance; readonly name = "CloudFormation Validate"; private readonly engine; constructor(props?: CloudFormationValidatePluginProps); get version(): string | undefined; get ruleIds(): string[] | undefined; validate(context: IPolicyValidationContext): PolicyValidationPluginReport; }