Class SelfManagedKafkaEventSource

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.lambda.eventsources.StreamEventSource
software.amazon.awscdk.services.lambda.eventsources.SelfManagedKafkaEventSource
All Implemented Interfaces:
IEventSource, software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.121.0 (build d7af9b9)", date="2025-12-18T18:20:12.867Z") @Stability(Stable) public class SelfManagedKafkaEventSource extends StreamEventSource
Use a self hosted Kafka installation as a streaming source for AWS Lambda.

Example:

 import software.amazon.awscdk.services.lambda.eventsources.SelfManagedKafkaEventSource;
 import software.amazon.awscdk.services.lambda.eventsources.AuthenticationMethod;
 import software.amazon.awscdk.services.lambda.StartingPosition;
 import software.amazon.awscdk.services.lambda.Function;
 import software.amazon.awscdk.services.secretsmanager.ISecret;
 // With provisioned pollers and poller group for cost optimization
 Function myFunction;
 ISecret kafkaCredentials;
 myFunction.addEventSource(SelfManagedKafkaEventSource.Builder.create()
         .bootstrapServers(List.of("kafka-broker1.example.com:9092", "kafka-broker2.example.com:9092"))
         .topic("events-topic")
         .secret(kafkaCredentials)
         .startingPosition(StartingPosition.LATEST)
         .authenticationMethod(AuthenticationMethod.SASL_SCRAM_512_AUTH)
         .provisionedPollerConfig(ProvisionedPollerConfig.builder()
                 .minimumPollers(1)
                 .maximumPollers(8)
                 .pollerGroupName("self-managed-kafka-group")
                 .build())
         .build());
 
  • Constructor Details

    • SelfManagedKafkaEventSource

      protected SelfManagedKafkaEventSource(software.amazon.jsii.JsiiObjectRef objRef)
    • SelfManagedKafkaEventSource

      protected SelfManagedKafkaEventSource(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • SelfManagedKafkaEventSource

      @Stability(Stable) public SelfManagedKafkaEventSource(@NotNull SelfManagedKafkaEventSourceProps props)
      Parameters:
      props - This parameter is required.
  • Method Details

    • bind

      @Stability(Stable) public void bind(@NotNull IFunction target)
      Called by lambda.addEventSource to allow the event source to bind to this function.

      Specified by:
      bind in interface IEventSource
      Specified by:
      bind in class StreamEventSource
      Parameters:
      target - This parameter is required.