class ManagedKafkaEventSource
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Lambda.EventSources.ManagedKafkaEventSource |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awslambdaeventsources#ManagedKafkaEventSource |
Java | software.amazon.awscdk.services.lambda.eventsources.ManagedKafkaEventSource |
Python | aws_cdk.aws_lambda_event_sources.ManagedKafkaEventSource |
TypeScript (source) | aws-cdk-lib » aws_lambda_event_sources » ManagedKafkaEventSource |
Implements
IEvent
Extends
Stream
Use a MSK cluster as a streaming source for AWS Lambda.
Example
import { ManagedKafkaEventSource } from 'aws-cdk-lib/aws-lambda-event-sources';
import { StartingPosition, Function } from 'aws-cdk-lib/aws-lambda';
// With provisioned pollers and poller group for cost optimization
declare const myFunction: Function;
myFunction.addEventSource(new ManagedKafkaEventSource({
clusterArn: 'arn:aws:kafka:us-east-1:123456789012:cluster/my-cluster/abcd1234-abcd-cafe-abab-9876543210ab-4',
topic: 'orders-topic',
startingPosition: StartingPosition.LATEST,
provisionedPollerConfig: {
minimumPollers: 2,
maximumPollers: 10,
pollerGroupName: 'shared-kafka-pollers',
},
}));
Initializer
new ManagedKafkaEventSource(props: ManagedKafkaEventSourceProps)
Parameters
Properties
| Name | Type | Description |
|---|---|---|
| event | string | The ARN for this EventSourceMapping. |
| event | string | The identifier for this EventSourceMapping. |
eventSourceMappingArn
Type:
string
The ARN for this EventSourceMapping.
eventSourceMappingId
Type:
string
The identifier for this EventSourceMapping.
Methods
| Name | Description |
|---|---|
| bind(target) | Called by lambda.addEventSource to allow the event source to bind to this function. |
bind(target)
public bind(target: IFunction): void
Parameters
- target
IFunction
Called by lambda.addEventSource to allow the event source to bind to this function.

.NET
Go
Java
Python
TypeScript (