Interface ManagedKafkaEventSourceProps

All Superinterfaces:
BaseStreamEventSourceProps, software.amazon.jsii.JsiiSerializable, KafkaEventSourceProps
All Known Implementing Classes:
ManagedKafkaEventSourceProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)", date="2024-09-18T22:16:58.658Z") @Stability(Stable) public interface ManagedKafkaEventSourceProps extends software.amazon.jsii.JsiiSerializable, KafkaEventSourceProps
Properties for a MSK event source.

Example:

 import software.amazon.awscdk.services.secretsmanager.Secret;
 import software.amazon.awscdk.services.lambda.eventsources.ManagedKafkaEventSource;
 Function myFunction;
 // Your MSK cluster arn
 String clusterArn = "arn:aws:kafka:us-east-1:0123456789019:cluster/SalesCluster/abcd1234-abcd-cafe-abab-9876543210ab-4";
 // The Kafka topic you want to subscribe to
 String topic = "some-cool-topic";
 // The secret that allows access to your MSK cluster
 // You still have to make sure that it is associated with your cluster as described in the documentation
 Secret secret = Secret.Builder.create(this, "Secret").secretName("AmazonMSK_KafkaSecret").build();
 myFunction.addEventSource(ManagedKafkaEventSource.Builder.create()
         .clusterArn(clusterArn)
         .topic(topic)
         .secret(secret)
         .batchSize(100) // default
         .startingPosition(StartingPosition.TRIM_HORIZON)
         .build());