CLOUD
Note
If you are installing the connector locally for Confluent Platform, see AWS Lambda Sink Connector for Confluent Platform.
The AWS Lambda function can be invoked by this connector either synchronously or asynchronously.
Important
If you are still on Confluent Cloud Enterprise, please contact your Confluent Account Executive for more information about using this connector.
The AWS Lambda Sink connector provides the following features:
Synchronous and Asynchronous Lambda function invocation: The AWS Lambda function can be invoked by this connector either synchronously or asynchronously.
Results topics: In synchronous mode, AWS Lambda results are stored in the following topics:
success-<connector-id>
error-<connector-id>
Input Data Format with or without a Schema: The connector supports input data from Kafka topics in Avro, JSON Schema (JSON_SR), Protobuf, JSON (schemaless), or Bytes format. Schema Registry must be enabled to use a Schema Registry-based format.
If no schema is defined, values are encoded as plain strings. For example, "name": "Kimberley Human" is encoded as name=Kimberley Human.
"name": "Kimberley Human"
name=Kimberley Human
You can manage your full-service connector using the Confluent Cloud API. For details, see the Confluent Cloud API documentation.
Refer to Confluent Cloud connector limitations for additional information.
Use this quick start to get up and running with the Confluent Cloud AWS Lambda Sink connector. The quick start provides the basics of selecting the connector and configuring it to send records to AWS Lambda.
Authorized access to a Confluent Cloud cluster on AWS.
The Confluent Cloud CLI installed and configured for the cluster. See Install the Confluent Cloud CLI.
Schema Registry must be enabled to use a Schema Registry-based format (for example, Avro, JSON_SR (JSON Schema), or Protobuf).
Your AWS Lambda project should be in the same region as your Confluent Cloud cluster where you are running the connector.
An AWS account configured with Access Keys.
You need to configure a Lambda IAM policy for the account to allow lambda:InvokeFunction and lambda:GetFunction. The following shows a JSON example for setting this policy:
lambda:InvokeFunction
lambda:GetFunction
{ "Version": "2012-10-17", "Statement": [ { "Sid": "VisualEditor0", "Effect": "Allow", "Action": [ "lambda:InvokeFunction", "lambda:GetFunction" ], "Resource": "*" } ] }
See the Quick Start for Apache Kafka using Confluent Cloud for installation instructions.
Click Connectors. If you already have connectors in your cluster, click Add connector.
Click the AWS Lambda Sink connector icon.
Complete the following and click Continue.
Select one or more topics.
Enter a Connector Name.
Select an Input message format (data coming from the Kafka topic): AVRO, JSON_SR (JSON Schema), PROTOBUF, JSON (schemaless), or BYTES. A valid schema must be available in Schema Registry to use a schema-based message format.
Enter your Kafka Cluster credentials. The credentials are either the API key and secret or the service account API key and secret.
Enter your AWS credentials. For information about how to set these up, see Access Keys.
Enter the Lambda function to invoke. For additional information, see the What is AWS Lambda.
Select the Lambda invocation type:
Enter the maximum number of records to send as a batch for a single Lambda function invokation. The default is 20 records.
Enter the number of tasks in use by the connector.
Validate the connector properties and click Launch.
The status for the connector should go from Provisioning to Running.
Got to the AWS Lambda console, open the Lambda function, and verify that records are processing. You can check for processing on the Monitoring tab on the Lambda function page. In synchronous mode, AWS Lambda results are stored in the following topics:
Tip
When you launch a connector, a Dead Letter Queue topic is automatically created. See Dead Letter Queue for details.
For additional information about the AWS Lambda Sink connector see AWS Lambda Sink Connector for Confluent Platform. Note that not all Confluent Platform Lamdba Sink connector features are provided in the Confluent Cloud Lambda Sink connector.
See also
For an example that shows fully-managed Confluent Cloud connectors in action with Confluent Cloud ksqlDB, see the Cloud ETL Demo. This example also shows how to use Confluent Cloud CLI to manage your resources in Confluent Cloud.
Complete the following steps to set up and run the connector using the Confluent Cloud CLI.
Make sure you have all your prerequisites completed.
Enter the following command to list available connectors:
ccloud connector-catalog list
Enter the following command to show the required connector properties:
ccloud connector-catalog describe <connector-catalog-name>
For example:
ccloud connector-catalog describe LambdaSink
Example output:
Following are the required configs: connector.class: LambdaSink name topics input.data.format connector.class kafka.api.key kafka.api.secret aws.access.key.id aws.secret.access.key aws.lambda.function.name aws.lambda.invocation.type tasks.max
Create a JSON file that contains the connector configuration properties. The following example shows the required connector properties.
{ "connector.class": "LambdaSink", "name": "LambdaSinkConnector_0", "topics": "users", "input.data.format": "JSON", "connector.class": "LambdaSink", "kafka.api.key": "****************", "kafka.api.secret": "*************************************************", "aws.access.key.id": "****************", "aws.secret.access.key": "********************************************", "aws.lambda.function.name": "myLambdaFunction", "aws.lambda.invocation.type": "sync", "tasks.max": "1" }
Note the following required property definitions:
"connector.class": Identifies the connector plugin name.
"connector.class"
"name": Sets a name for your new connector.
"name"
"topics": Identifies the topic name or a comma-separated list of topic names.
"topics"
"input.data.format": Sets the input message format (data coming from the Kafka topic). Valid entries are AVRO, JSON_SR (JSON Schema), PROTOBUF, JSON (Schemaless), or BYTES. You must have Confluent Cloud Schema Registry configured if using a schema-based message format.
"input.data.format"
"aws.access.key.id" and "aws.secret.access.key": Enter the AWS Access Key ID and Secret. For information about how to set these up, see Access Keys.
"aws.access.key.id"
"aws.secret.access.key"
"aws.lambda.function.name": Enter the Lambda function to invoke. For additional information, see the What is AWS Lambda.
"aws.lambda.function.name"
"aws.lambda.invocation.type":
"aws.lambda.invocation.type"
"sync"
"async"
"tasks.max": Enter the number of tasks in use by the connector. Refer to Confluent Cloud connector limitations for additional information.
"tasks.max"
Enter the following command to load the configuration and start the connector:
ccloud connector create --config <file-name>.json
ccloud connector create --config lambda-sink-config.json
Created connector LambdaSinkConnector_0 lcc-ix4dl
Enter the following command to check the connector status:
ccloud connector list
ID | Name | Status | Type +-----------+-----------------------+---------+------+ lcc-ix4dl | LambdaSinkConnector_0 | RUNNING | sink
For additional information about the AWS Lambda Sink connector see AWS Lambda Sink Connector for Confluent Platform. Note that not all Confluent Platform features are provided in the Confluent Cloud connector.