# LambdaValidator

Defines an AWS Lambda validator.

Extends: LambdaValidator
Implements: IValidator

- Source: [`aws-appconfig/lib/configuration.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-appconfig/lib/configuration.ts#L838)
- Type last changed: v2.130.0 · 23 Feb 2024

## Example

```ts
declare const application: appconfig.Application;
declare const fn: lambda.Function;

new appconfig.HostedConfiguration(this, 'MyHostedConfiguration', {
  application,
  content: appconfig.ConfigurationContent.fromInlineText('This is my configuration content.'),
  validators: [
    appconfig.JsonSchemaValidator.fromFile('schema.json'),
    appconfig.LambdaValidator.fromFunction(fn),
  ],
});
```

## Initializer

```ts
new LambdaValidator()
```

## Properties

- `content`: string — The content of the validator.

- `type`: [ValidatorType](/cdk/api/v2/docs/aws-cdk-lib.aws_appconfig.ValidatorType.html) — The type of validator.

## Methods

- `fromFunction(func: Function): LambdaValidator // chainable` (static) — Defines an AWS Lambda validator from a Lambda function.

  This will call
  `addPermission` to your function to grant AWS AppConfig permissions.

  **Parameters**

  - `func` — The function that defines the validator.
