class KafkaSchemaValidationAttribute
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Lambda.KafkaSchemaValidationAttribute |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awslambda#KafkaSchemaValidationAttribute |
Java | software.amazon.awscdk.services.lambda.KafkaSchemaValidationAttribute |
Python | aws_cdk.aws_lambda.KafkaSchemaValidationAttribute |
TypeScript (source) | aws-cdk-lib » aws_lambda » KafkaSchemaValidationAttribute |
Specific schema validation configuration settings that tell Lambda the message attributes you want to validate and filter using your schema registry.
Example
import { ManagedKafkaEventSource, ConfluentSchemaRegistry } from 'aws-cdk-lib/aws-lambda-event-sources';
import { Secret } from 'aws-cdk-lib/aws-secretsmanager';
// Your MSK cluster arn
declare const clusterArn: string;
// The Kafka topic you want to subscribe to
const topic = 'some-cool-topic';
const secret = new Secret(this, 'Secret', { secretName: 'AmazonMSK_KafkaSecret' });
declare const myFunction: lambda.Function;
myFunction.addEventSource(new ManagedKafkaEventSource({
clusterArn,
topic,
startingPosition: lambda.StartingPosition.TRIM_HORIZON,
provisionedPollerConfig: {
minimumPollers: 1,
maximumPollers: 3,
},
schemaRegistryConfig: new ConfluentSchemaRegistry({
schemaRegistryUri: 'https://example.com',
eventRecordFormat: lambda.EventRecordFormat.JSON,
authenticationType: lambda.KafkaSchemaRegistryAccessConfigType.BASIC_AUTH,
secret: secret,
schemaValidationConfigs: [{ attribute: lambda.KafkaSchemaValidationAttribute.KEY }],
}),
}));
Properties
| Name | Type | Description |
|---|---|---|
| value | string | The enum to use in SchemaRegistryConfig.SchemaValidationConfigs.Attribute property in CloudFormation. |
| static KEY | Kafka | De-serialize the key field of the parload to target function. |
| static VALUE | Kafka | De-serialize the value field of the parload to target function. |
value
Type:
string
The enum to use in SchemaRegistryConfig.SchemaValidationConfigs.Attribute property in CloudFormation.
static KEY
Type:
Kafka
De-serialize the key field of the parload to target function.
static VALUE
Type:
Kafka
De-serialize the value field of the parload to target function.
Methods
| Name | Description |
|---|---|
| static of(name) | A custom schema validation attribute property. |
static of(name)
public static of(name: string): KafkaSchemaValidationAttribute
Parameters
- name
string
Returns
A custom schema validation attribute property.

.NET
Go
Java
Python
TypeScript (