CfnRegistryProps Struct
Properties for defining a CfnRegistry.
Example
ts
import { CfnRegistry } from 'aws-cdk-lib/aws-glue';
import { ManagedKafkaEventSource, GlueSchemaRegistry } from 'aws-cdk-lib/aws-lambda-event-sources';
// Your MSK cluster arn
declare const clusterArn: string;
// The Kafka topic you want to subscribe to
const topic = 'some-cool-topic';
// Your Glue Schema Registry
const glueRegistry = new CfnRegistry(this, 'Registry', {
name: 'schema-registry',
description: 'Schema registry for event source',
});
declare const myFunction: lambda.Function;
myFunction.addEventSource(new ManagedKafkaEventSource({
clusterArn,
topic,
startingPosition: lambda.StartingPosition.TRIM_HORIZON,
provisionedPollerConfig: {
minimumPollers: 1,
maximumPollers: 3,
},
schemaRegistryConfig: new GlueSchemaRegistry({
schemaRegistry: glueRegistry,
eventRecordFormat: lambda.EventRecordFormat.JSON,
schemaValidationConfigs: [{ attribute: lambda.KafkaSchemaValidationAttribute.KEY }],
}),
}));
Properties
A description of the registry.
The name of the registry.