Skip to content
v2.275.0

ProvisionedPollerConfig Struct ​

(Amazon MSK and self-managed Apache Kafka only) The provisioned mode configuration for the event source.

Example ​

ts
import { ManagedKafkaEventSource } from 'aws-cdk-lib/aws-lambda-event-sources';

// Your MSK cluster arn
const clusterArn = 'arn:aws:kafka:us-east-1:0123456789019:cluster/SalesCluster/abcd1234-abcd-cafe-abab-9876543210ab-4';

declare const myFunction: lambda.Function;

// Enable basic event and error metrics
myFunction.addEventSource(new ManagedKafkaEventSource({
  clusterArn,
  topic: 'basic-monitoring',
  startingPosition: lambda.StartingPosition.LATEST,
  // Provisioned mode is required for observability features
  provisionedPollerConfig: {
    minimumPollers: 2,
    maximumPollers: 10,
  },
  metricsConfig: {
    metrics: [
      lambda.MetricType.EVENT_COUNT,
      lambda.MetricType.ERROR_COUNT
    ]
  }
}));

Properties ​

maximumPollersoptionalnumbermaximum_pollersoptionalint | floatmaximumPollersoptionalNumberMaximumPollersoptionaldoubleMaximumPollersoptional*float64= 200#
The maximum number of pollers that can be provisioned.

Valid Range: Minimum value of 1. Maximum value of 2000.

minimumPollersoptionalnumberminimum_pollersoptionalint | floatminimumPollersoptionalNumberMinimumPollersoptionaldoubleMinimumPollersoptional*float64= 1#
The minimum number of pollers that should be provisioned.

Valid Range: Minimum value of 1. Maximum value of 200.

pollerGroupNameoptionalstringpoller_group_nameoptionalstrpollerGroupNameoptionalStringPollerGroupNameoptionalstringPollerGroupNameoptional*string#
An optional identifier that groups multiple ESMs to share EPU capacity and reduce costs.

Default: not set, dedicated compute resource per event source.

ESMs with the same PollerGroupName share compute resources.