Interface ManagedKafkaEventSourceProps
- All Superinterfaces:
BaseStreamEventSourceProps
,software.amazon.jsii.JsiiSerializable
,KafkaEventSourceProps
- All Known Implementing Classes:
ManagedKafkaEventSourceProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:46.834Z")
@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());
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
A builder forManagedKafkaEventSourceProps
static final class
An implementation forManagedKafkaEventSourceProps
-
Method Summary
Methods inherited from interface software.amazon.awscdk.services.lambda.eventsources.BaseStreamEventSourceProps
getBatchSize, getEnabled, getMaxBatchingWindow, getStartingPosition
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
Methods inherited from interface software.amazon.awscdk.services.lambda.eventsources.KafkaEventSourceProps
getSecret, getTopic
-
Method Details
-
getClusterArn
An MSK cluster construct. -
builder
-