AuthenticationMethod

class aws_cdk.aws_lambda_event_sources.AuthenticationMethod(*values)

Bases: Enum

The authentication method to use with SelfManagedKafkaEventSource.

ExampleMetadata:

infused

Example:

from aws_cdk.aws_lambda_event_sources import ProvisionedPollerConfig
from aws_cdk.aws_lambda_event_sources import SelfManagedKafkaEventSource, AuthenticationMethod
from aws_cdk.aws_lambda import StartingPosition, Function
from aws_cdk.aws_secretsmanager import ISecret

# With provisioned pollers and poller group for cost optimization
# my_function: Function
# kafka_credentials: ISecret

my_function.add_event_source(SelfManagedKafkaEventSource(
    bootstrap_servers=["kafka-broker1.example.com:9092", "kafka-broker2.example.com:9092"],
    topic="events-topic",
    secret=kafka_credentials,
    starting_position=StartingPosition.LATEST,
    authentication_method=AuthenticationMethod.SASL_SCRAM_512_AUTH,
    provisioned_poller_config=ProvisionedPollerConfig(
        minimum_pollers=1,
        maximum_pollers=8,
        poller_group_name="self-managed-kafka-group"
    )
))

Attributes

BASIC_AUTH

BASIC_AUTH (SASL/PLAIN) authentication method for your Kafka cluster.

CLIENT_CERTIFICATE_TLS_AUTH

CLIENT_CERTIFICATE_TLS_AUTH (mTLS) authentication method for your Kafka cluster.

SASL_SCRAM_256_AUTH

SASL_SCRAM_256_AUTH authentication method for your Kafka cluster.

SASL_SCRAM_512_AUTH

SASL_SCRAM_512_AUTH authentication method for your Kafka cluster.