ProvisionedPollerConfig

class aws_cdk.aws_lambda_event_sources.ProvisionedPollerConfig(*, maximum_pollers, minimum_pollers)

Bases: object

Parameters:
  • maximum_pollers (Union[int, float]) – The maximum number of pollers that can be provisioned. Default: 200

  • minimum_pollers (Union[int, float]) – The minimum number of pollers that should be provisioned. Default: 1

ExampleMetadata:

infused

Example:

from aws_cdk.aws_lambda_event_sources import ManagedKafkaEventSource

# Your MSK cluster arn
# cluster_arn: str

# my_function: lambda.Function


# The Kafka topic you want to subscribe to
topic = "some-cool-topic"
my_function.add_event_source(ManagedKafkaEventSource(
    cluster_arn=cluster_arn,
    topic=topic,
    starting_position=lambda_.StartingPosition.TRIM_HORIZON,
    provisioned_poller_config=ProvisionedPollerConfig(
        minimum_pollers=1,
        maximum_pollers=3
    )
))

Attributes

maximum_pollers

The maximum number of pollers that can be provisioned.

Default:

200

minimum_pollers

The minimum number of pollers that should be provisioned.

Default:

1