Class ConfluentSchemaRegistry
Confluent schema registry configuration for a Lambda event source.
Implements
Namespace: Amazon.CDK.AWS.Lambda.EventSources
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class ConfluentSchemaRegistry : DeputyBase, ISchemaRegistry
Syntax (vb)
Public Class ConfluentSchemaRegistry Inherits DeputyBase Implements ISchemaRegistry
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.Lambda.EventSources;
using Amazon.CDK.AWS.SecretsManager;
// Your MSK cluster arn
string clusterArn;
Function myFunction;
// The Kafka topic you want to subscribe to
var topic = "some-cool-topic";
var secret = new Secret(this, "Secret", new SecretProps { SecretName = "AmazonMSK_KafkaSecret" });
myFunction.AddEventSource(new ManagedKafkaEventSource(new ManagedKafkaEventSourceProps {
ClusterArn = clusterArn,
Topic = topic,
StartingPosition = StartingPosition.TRIM_HORIZON,
ProvisionedPollerConfig = new ProvisionedPollerConfig {
MinimumPollers = 1,
MaximumPollers = 3
},
SchemaRegistryConfig = new ConfluentSchemaRegistry(new ConfluentSchemaRegistryProps {
SchemaRegistryUri = "https://example.com",
EventRecordFormat = EventRecordFormat.JSON,
AuthenticationType = KafkaSchemaRegistryAccessConfigType.BASIC_AUTH,
Secret = secret,
SchemaValidationConfigs = new [] { new KafkaSchemaValidationConfig { Attribute = KafkaSchemaValidationAttribute.KEY } }
})
}));
Synopsis
Constructors
ConfluentSchemaRegistry(IConfluentSchemaRegistryProps) | Confluent schema registry configuration for a Lambda event source. |
Methods
Bind(IEventSourceMapping, IFunction) | Returns a schema registry configuration. |
Constructors
ConfluentSchemaRegistry(IConfluentSchemaRegistryProps)
Confluent schema registry configuration for a Lambda event source.
public ConfluentSchemaRegistry(IConfluentSchemaRegistryProps props)
Parameters
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.Lambda.EventSources;
using Amazon.CDK.AWS.SecretsManager;
// Your MSK cluster arn
string clusterArn;
Function myFunction;
// The Kafka topic you want to subscribe to
var topic = "some-cool-topic";
var secret = new Secret(this, "Secret", new SecretProps { SecretName = "AmazonMSK_KafkaSecret" });
myFunction.AddEventSource(new ManagedKafkaEventSource(new ManagedKafkaEventSourceProps {
ClusterArn = clusterArn,
Topic = topic,
StartingPosition = StartingPosition.TRIM_HORIZON,
ProvisionedPollerConfig = new ProvisionedPollerConfig {
MinimumPollers = 1,
MaximumPollers = 3
},
SchemaRegistryConfig = new ConfluentSchemaRegistry(new ConfluentSchemaRegistryProps {
SchemaRegistryUri = "https://example.com",
EventRecordFormat = EventRecordFormat.JSON,
AuthenticationType = KafkaSchemaRegistryAccessConfigType.BASIC_AUTH,
Secret = secret,
SchemaValidationConfigs = new [] { new KafkaSchemaValidationConfig { Attribute = KafkaSchemaValidationAttribute.KEY } }
})
}));
Methods
Bind(IEventSourceMapping, IFunction)
Returns a schema registry configuration.
public virtual IKafkaSchemaRegistryConfig Bind(IEventSourceMapping target, IFunction targetHandler)
Parameters
- target IEventSourceMapping
- targetHandler IFunction
Returns
Remarks
ExampleMetadata: infused