# Validations

Manages validations for CDK constructs.

- Source: [`core/lib/validation/validations.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/core/lib/validation/validations.ts#L34)
- Type last changed: v2.252.0 · 30 Apr 2026

## Example

```ts
/// fixture=validation-plugin
declare const myApp: App;
declare const plugin: IPolicyValidationPlugin;
Validations.of(myApp).addPlugins(plugin);
```

## Properties

- `ACKNOWLEDGED_RULES_METADATA_KEY`: string (static) — Metadata key used to store acknowledged rules on construct nodes.

  Plugin authors can read this metadata to build audit trails from
  acknowledgments recorded via `acknowledge()`.

## Methods

- `acknowledge(...rules: Acknowledgment[]): void` — Acknowledge one or more rules, suppressing them from validation output.

  Acknowledgments are recorded to construct metadata so that downstream
  plugins (e.g. CDK Nag) can read them for audit trails.

  Currently only annotation warnings can be suppressed. Annotation errors
  are not yet acknowledgeable.

  If an ID has no well-known prefix, it is assumed to be an annotation rule
  for backwards compatibility.

  **Parameters**

  - `rules` — the rules to acknowledge.

- `addError(id: string, message: string): void` — Adds an error metadata entry to this construct.

  Synthesis will be interrupted when errors are reported.

  Note: Annotation errors are not currently acknowledgeable. The ID is
  recorded for identification purposes but `acknowledge()` will not
  suppress errors added via this method.

  **Parameters**

  - `id` — unique identifier for the error.
  - `message` — the error message.

- `addPlugins(...plugins: IPolicyValidationPlugin[]): void` — Register one or more validation plugins that will be executed during synthesis.

  Plugins can only be registered within a Stage or App scope.
  If any plugin reports a violation, synthesis will be interrupted and the
  report displayed to the user.

  **Parameters**

  - `plugins` — the validation plugins to add.

- `addWarning(id: string, message: string): void` — Adds a warning metadata entry to this construct that can be acknowledged.

  The CLI will display the warning when an app is synthesized, or fail if run
  in `--strict` mode.

  The ID will be stored with the `annotation` prefix (e.g. `annotation::MyWarning`).
  Use this prefixed ID when calling `acknowledge()` to suppress the warning.

  **Parameters**

  - `id` — unique identifier for the warning, used for acknowledgement.
  - `message` — the warning message.

- `of(scope: IConstruct): Validations // chainable` (static) — Returns the Validations for the given construct scope.

  **Parameters**

  - `scope` — any construct.
